Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Nested transactions and rollback
Message
 
 
À
09/03/2010 04:00:55
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01453374
Message ID:
01453416
Vues:
31
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform