SP inside SP and transactions

Puiu

Well-known member
Joined
Oct 6, 2004
Messages
90
Lets say I have a stored procedure SP_Master with a code similar to this:

Code:
create proc sp_master
as
begin

begin tran

exec sp1
exec sp2

update table1 set...

rollback
end

My question: the rollback statement will also rollback the changes made by sp1 and sp2?

Thanks
 
Under SQL a ROLLBACK statement rolls back all active transactions. In your example this would include updates performed by both sp1 and sp2.
 
Back
Top