Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

try catch sql transaction

BEGIN TRANSACTION [Tran1]            
BEGIN TRY           
-- sql statements(update/insert...)     
COMMIT TRANSACTION [Tran1]      
END TRY      
      
BEGIN CATCH      
ROLLBACK TRANSACTION [Tran1]      
SELECT ERROR_MESSAGE() AS ErrorMessage;      
END CATCH     
 
PREVIOUS NEXT
Tagged: #catch #sql #transaction
ADD COMMENT
Topic
Name
2+2 =