Created
October 27, 2011 13:56
-
-
Save jeffsaracco/1319605 to your computer and use it in GitHub Desktop.
SQL Transaction w/rollback
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 | |
--SQL CODE HERE | |
if @@ERROR <> 0 | |
BEGIN | |
ROLLBACK TRANSACTION | |
END | |
ELSE | |
BEGIN | |
COMMIT TRANSACTION | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment