Groups | Blog | Home
all groups > sql server new users > march 2005 >

sql server new users : Rollback entire procedure


Phil Holmes - ITP
3/26/2005 3:57:01 AM
Is it possible to add an instruction to rollback the entire procedure, if any
Tom Moreau
3/26/2005 8:06:36 AM
You can issue a BEGIN TRAN inside the proc and then test @@ERROR for each
subsequent data mod. If it is non-zero, then issue ROLLBACK TRAN. Finally,
don't forget to issue COMMIT TRAN.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
..
"Phil Holmes - ITP" <Phil Holmes - ITP@discussions.microsoft.com> wrote in
message news:BE44893A-6401-4F07-B4B7-3D57A6E7D140@microsoft.com...
Is it possible to add an instruction to rollback the entire procedure, if
any
part of the procedure fails ?
AddThis Social Bookmark Button