Comments
Sort by recent activity
+1 here / comments
+1 here
The point of the error is that your procedure in its entirety isn't encapsulated in a BEGIN/END block, not the entire statement. What it is looking for you to do is this; CREATE OR ALTER PROCEDURE #ST003_EXAMPLE AS
BEGIN
BEGIN
PRINT 'Great';
END;
-- some debug after END...
THROW 50000, 'Really!', 1;
END;
GO -- Separated statement for easy executing whole window from SSMS
EXECUTE #ST003_EXAMPLE;
/ comments
The point of the error is that your procedure in its entirety isn't encapsulated in a BEGIN/END block, not the entire statement. What it is looking for you to do is this;CREATE OR ALTER PROCEDURE #...