Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nested transactions and rollback
Message
 
 
To
09/03/2010 04:00:55
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01453374
Message ID:
01453416
Views:
30
>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

Please see this blog How to insert information into multiple related tables and return ID using SQLDataSource
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform