Skip to content

Instantly share code, notes, and snippets.

@eternaltung
Last active August 29, 2015 14:16
Show Gist options
  • Save eternaltung/3220afcd166ccd3aded0 to your computer and use it in GitHub Desktop.
Save eternaltung/3220afcd166ccd3aded0 to your computer and use it in GitHub Desktop.
CREATE PROCEDURE [dbo].[sp_Test1]
@table1_Id INT OUTPUT
AS
begin try
begin transaction
print 'sp_Test1:executing sp_Test2'
exec sp_Test2 @table1_Id output
print 'sp_Test1:executing sp_Test3'
exec sp_Test3
print 'commit tran'
commit transaction
end try
begin catch
rollback transaction
print 'sp_Test1:in catch'
RAISERROR('raiseerror:sp_Test1', 16, 1)
end catch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment