gotchasqlMinor
Difference Between SP with BEGIN/END and without BEGIN/END
Viewed 0 times
withoutwithdifferencebetweenendandbegin
Problem
I have found some SP(stored procedure) written as,
and some as
What makes it difference?
CREATE PROCEDURE [dbo].[XXX]
(
-- Parameters
)
BEGIN
--- Actual Work
ENDand some as
CREATE PROCEDURE [dbo].[XXX]
(
-- Parameters
)
--- Actual WorkWhat makes it difference?
Solution
There is no real difference. Create procedure syntax specifies
BEGIN and END as optional. And it makes sense since CREATE PROCEDURE statement cannot be combined with other statements in a single batch.Context
StackExchange Database Administrators Q#44231, answer score: 5
Revisions (0)
No revisions yet.