Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 making a rollback

Author  Topic 

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-06-22 : 03:48:07
i have a StoredProcedures which call to each other
each one contians begin trnas and rollback commands'
the order is like this
SP1->SP2->SP3
SP4
SP5
my problem is if SP3 fils it dosent do SP4 and SP5 but rather do a rollback up to SP1.
what i want to do is that if even SP3 fails it will continure to do SP4 and SP5 and WONT!!! rollback to SP1!!!
how can i do this?
thnaks inadvance
peleg

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-06-22 : 03:56:05
The ROLLBACK TRAN does not meet the number of BEGIN TRAN.

If unsure, name the transactions as in SP1

BEGIN TRAN MyTran1

and then COMMIT TRAN MyTran1 or ROLLBACK TRAN MyTran1

Do the same for SP2, SP3, SP4 and SP5.



BEGIN TRAN MyTranX

COMMIT TRAN MyTranX
ROLLBACK TRAN MyTranX


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-22 : 04:11:52
http://www.sommarskog.se/error-handling-I.html

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -