SA0151 : Statements appear after procedures main BEGIN/END block. Possible missing GO command
The topic describes the SA0151 analysis rule.
Statements appear after procedures main BEGIN/END block. Possible missing GO command
The rule checks for stored procedures, which have their main code enclosed in BEGIN/END block, but also have other statements appearing after this block.
It is possible that a GO end of batch signaling command is missing and the statements in the script following the procedure are included by accident in the procedure's body.
The rule has a Batch scope and is applied only on the SQL script.
Rule has no parameters.
The rule does not need Analysis Context or SQL Connection.
There is no additional info for this rule.
1ALTER PROCEDURE dbo.FooGetTableA 2 ( 3 @Parameter varchar(4) 4 ) 5AS 6BEGIN 7 SELECT Column1 8 FROM dbo.TableA 9 WHERE Column2 = @Parameter 10END 11 12EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Some description for the procedure.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'FooGetTableA'
|1||SA0151 : Possible missing GO statement. Statement appears after procedure's FooGetTableA main BEGIN/END block.||12||0|
© Ubitsoft Ltd. All Rights Reserved.