Skip to content

Instantly share code, notes, and snippets.

@geoder101
Created October 30, 2014 08:12
Show Gist options
  • Save geoder101/bb694b7a9bfe7692ec6f to your computer and use it in GitHub Desktop.
Save geoder101/bb694b7a9bfe7692ec6f to your computer and use it in GitHub Desktop.
t-sql transaction commit/rollback template
BEGIN TRY
BEGIN TRANSACTION
-- insert sql here
COMMIT
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0 ROLLBACK
END CATCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment