Skip to content

Instantly share code, notes, and snippets.

@gscattolin
Created November 5, 2013 14:21
Show Gist options
  • Select an option

  • Save gscattolin/7319709 to your computer and use it in GitHub Desktop.

Select an option

Save gscattolin/7319709 to your computer and use it in GitHub Desktop.
Transaction with RollBack
SET XACT_ABORT ON
BEGIN TRY
BEGIN TRANSACTION
--work code here
COMMIT TRANSACTION
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION
--cleanup code
END CATCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment