Skip to content

Instantly share code, notes, and snippets.

@dmjio
Created May 31, 2012 05:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dmjio/2841239 to your computer and use it in GitHub Desktop.
Sql Trans roll back
SET XACT_ABORT ON
BEGIN TRY
BEGIN TRAN
--select * from vendor where vendorid = '37febdc9-a471-458c-b6b9-058ff69a85d3'
--select * from document
PRINT 'All statements executed, manually commit'
-- COMMIT
END TRY
BEGIN CATCH
PRINT ERROR_MESSAGE()
PRINT 'Rolling back'
ROLLBACK
END CATCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment