SQL 2008 - Nested transactions
-
Hello, I have this structure :
CREATE PROCEDURE external_sp AS BEGIN BEGIN TRANSACTION EXEC internal_sp @param1,@result out if( @result <> 1 ) BEGIN COMMIT TRANSACTION END ELSE BEGIN ROLLBACK TRANSACTION END END
The problem : inside the stored procedure "internal_sp" there is another BEGIN TRANSACTION block. If this internal transaction block get rolled back, the outer transaction (in the external_sp stored procedure) fails. How can i solve this issue ?? Any help will be appreciated... -
Hello, I have this structure :
CREATE PROCEDURE external_sp AS BEGIN BEGIN TRANSACTION EXEC internal_sp @param1,@result out if( @result <> 1 ) BEGIN COMMIT TRANSACTION END ELSE BEGIN ROLLBACK TRANSACTION END END
The problem : inside the stored procedure "internal_sp" there is another BEGIN TRANSACTION block. If this internal transaction block get rolled back, the outer transaction (in the external_sp stored procedure) fails. How can i solve this issue ?? Any help will be appreciated...Hello, If you use internal transaction you don't need to use another transactions.
-
Hello, If you use internal transaction you don't need to use another transactions.