Last active
July 5, 2016 00:34
-
-
Save YurePereira/638543c8aefbdb2fe4ecdd2640f522e7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| -- Template to use transaction in SQL Server | |
| GO | |
| USE your_database_name; | |
| GO | |
| BEGIN TRANSACTION tran_your_transaction_name; | |
| GO | |
| -- | |
| -- SQL Commands here. | |
| -- | |
| GO | |
| IF @@ERRROR <> 0 | |
| ROLLBACK TRANSACTION tran_your_transaction_name; | |
| ELSE | |
| COMMIT TRANSACTION tran_your_transaction_name; | |
| GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment