SQL Server: error parsing string literals starting with 'as' #2060
Labels
Milestone
Comments
axelfontaine
added a commit
to flyway/flywaydb.org
that referenced
this issue
Jun 28, 2018
Good catch and thanks for beginning to narrow it down. Fixed. |
dohrayme
pushed a commit
to dohrayme/flyway
that referenced
this issue
Feb 3, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Which version and edition of Flyway are you using?
5.1.3 Community Edition
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
command-line
Which database are you using (type & version)?
SQL Server 2014
Which operating system are you using?
Windows 10
What did you do?
(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)
I'm trying to run the attached migration.
V1_4__Initial_create_functions_and_procs_4.txt
I get the error "Incorrect syntax near 'GO'".
Is this issue connected to #2011?
The parser seems to be confused by the contents of the "exists ()" starting on line 55. If I change line 55 of the migration to
if exists (select 1) begin
the migration runs correctly.Alternatively, if I remove from line 142 to the end of the file, it also runs correctly.
I haven't managed to narrow it down any further.
I have tried running flyway-commandline from the source code (in the master branch) and the problem still exists.
Command line:
..\flyway-5.1.3\flyway.cmd -configFiles="C:\Source\Databases\DatabaseProcsAndScripts\Migrations\flyway_migrate.conf" migrate
Config:
flyway.url=jdbc:sqlserver://localhost;databaseName=testmigrations;integratedSecurity=true
flyway.mixed=false
flyway.locations=filesystem:C:\Source\Databases\DatabaseProcsAndScripts\Migrations
What did you expect to see?
The migration runs successfully.
What did you see instead?
An error message: Incorrect syntax near 'GO'.
2018-06-28 13:46:10.105 ERROR : Migration V1_4__Initial_create_functions_and_procs_4.sql failed
SQL State : S0001
Error Code : 102
Message : Incorrect syntax near 'GO'.
Location : C:\Source\Databases\DatabaseProcsAndScripts\Migrations\V1_4__Initial_create_functions_and_procs_4.sql (C:\Source\Databases\DatabaseProcsAndScripts\Migrations\V1_4__Initial_create_functions_and_procs_4.sql)
Line : 8
The text was updated successfully, but these errors were encountered: