Created
June 24, 2015 07:35
-
-
Save dalibormesaric/3f10b58bc2a0e9a07d6d to your computer and use it in GitHub Desktop.
SQL TRANSACTION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN TRANSACTION | |
BEGIN TRY | |
-- | |
--ROLLBACK | |
COMMIT | |
TRANSACTION | |
END TRY | |
BEGIN CATCH | |
SELECT | |
ERROR_NUMBER() AS ErrorNumber, | |
ERROR_SEVERITY() AS ErrorSeverity, | |
ERROR_STATE() AS ErrorState, | |
ERROR_PROCEDURE() AS ErrorProcedure, | |
ERROR_LINE() AS ErrorLine, | |
ERROR_MESSAGE() AS ErrorMessage; | |
ROLLBACK TRANSACTION | |
END CATCH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment