General information
Forum:
Microsoft SQL Server
Title:
Nested transactions and rollback
Hi
I want to create a stored procedure that creates a Client record, then it adds a new record into the ClientOrder, ClientStock and ClientReturn tables using the newly created ClientID. However, I want the process to take place so that if any of the subsequent inserts fail, I can rollback all of the tables to the position they were in before the insert into Client (and rollback the Client table too).
I'd want a stored procedure called, for example, SP_Client_Add, and then that stored procedure would call SP_ClientOrder_Add, SP_ClientOrder_Add and SP_ClientReturn_Add. The reason for having the 3 child stored procedures is so that I can also call them individually if need be.
Regards
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only