Sql Trans roll back
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
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