The topic describes the DF075 T-SQL code analysis rule.
EXECUTION RULES
GO batch separator is possibly missing.
The procedure grants itself permissions at the end of its body. This may indicate that the GO command is missing.
In SQL Server, batches of SQL statements are typically separated by the GO batch separator. Each batch is compiled and executed separately. If the GO separator is missing, multiple statements may be combined into a single batch, leading to unexpected behavior or errors.
CREATE PROCEDURE dbo.DemoProc
AS
SELECT
*
FROM dbo.Customer;
GRANT EXECUTE ON dbo.DemoProc TO PUBLIC
GO
CREATE PROCEDURE dbo.DemoProc
AS
SELECT
*
FROM dbo.Customer;
GO
GRANT EXECUTE ON dbo.DemoProc TO PUBLIC
GO