Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
SQL Server: Incorrect syntax error using GOTO and Labels #2307
Which version and edition of Flyway are you using?
Flyway Pro Edition (20 schemas) 6.0.0-beta
If this is not the latest version, can you reproduce the issue with the latest one as well?
(Many bugs are fixed in newer releases and upgrading will often resolve the issue)
Issue only occurs in 6.0.0 Beta. 5.2.4 works properly.
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Which database are you using (type & version)?
SQL Server 2017 Developer Edition
Which operating system are you using?
What did you do?
We have a stored procedure that (unfortunately) uses a GOTO statement and a label. When the migration to create the stored procedure is executed via Flyway 6.0.0-beta, it gives an 'Incorrect syntax' error.
Here is a small sample script that will also reproduce the same issue. This works in Flyway 5.2.4 as well as SQL Server Management Studio.
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE OR ALTER PROCEDURE [dbo].[Test_Goto] AS BEGIN SET NOCOUNT ON; DECLARE @MyVar INT; SET @MyVar = 1; IF (@MyVar = 1) BEGIN GOTO Label PRINT 'This will not be printed.'; END; Label: PRINT 'This will always be printed'; END;
What did you expect to see?
What did you see instead?