Click here to Skip to main content
15,901,284 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how use try catch nested in sql ?
it case error when i do that !
Posted

 
Share this answer
 
Comments
Maciej Los 17-Oct-14 3:34am    
MSDN documentation is always good alternative ;)
snicee 17-Oct-14 4:07am    
its not nested


BEGIN TRY
BEGIN TRAN tt1
--------------------------------------------

BEGIN TRY
BEGIN TRAN tt2
--------------------------------------------

--------------------------------------------
COMMIT TRAN tt2

END TRY
BEGIN CATCH

ROLLBACK TRAN tt2
select ERROR_MESSAGE ( )
END CATCH
--------------------------------------------
COMMIT TRAN tt1

END TRY
BEGIN CATCH

ROLLBACK TRAN tt1
select ERROR_MESSAGE ( )
END CATCH

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900