MastermindSQL
Technical User
What is the difference between the following two cases:
Case 1:
CREATE PROC MyProc
AS
.....
RETURN
GO
----------
BEGIN TRAN
EXEC MyProc
COMMIT
===================
Case 2:
CREATE PROC MyProc
AS
BEGIN TRAN
.....
COMMIT
RETURN
GO
----------
EXEC MyProc
Which one of the above is a good practice and how the locks are handled (if there is any difference) in each case.
Thanks in advance.
Case 1:
CREATE PROC MyProc
AS
.....
RETURN
GO
----------
BEGIN TRAN
EXEC MyProc
COMMIT
===================
Case 2:
CREATE PROC MyProc
AS
BEGIN TRAN
.....
COMMIT
RETURN
GO
----------
EXEC MyProc
Which one of the above is a good practice and how the locks are handled (if there is any difference) in each case.
Thanks in advance.