I have found some SP(stored procedure) written as,
CREATE PROCEDURE [dbo].[XXX] ( -- Parameters ) BEGIN --- Actual Work END
and some as
CREATE PROCEDURE [dbo].[XXX] ( -- Parameters ) --- Actual Work
What makes it difference?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
There is no real difference. Create procedure syntax specifies
END as optional. And it makes sense since
CREATE PROCEDURE statement cannot be combined with other statements in a single batch.