Cybercrux

Everything is achievable through technology

SQL Try Catch

BEGIN TRY

BEGIN transaction
PRINT ‘Query starts’
–SQL Query
PRINT ‘Query ends’

Commit transaction

END TRY
BEGIN CATCH
Rollback transaction
END CATCH

Advertisements