
SQL Sproc Gotcha
December 8, 2011It’s easy to mistake the SQL Sproc syntax
ALTER PROCEDURE [dbo].[fooBar] ( ) AS -- etc RETURN @Success
With this. Note the BEGIN and END statements. It generally works for shorter queries, but for longer ones, you begin to get baffling SQL syntax queries, where sometimes it will execute the ALTER PROCEDURE, but things like changing the whitespace, reverting it, and executing it again will fail.
ALTER PROCEDURE [dbo].[fooBar] ( ) AS BEGIN -- etc RETURN @Success END
Advertisement