Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is a transaction implied
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Is a transaction implied
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01075733
Message ID:
01075733
Vues:
64
I am inserting a record into a "header" table and several records into a "details" table within the same SP.
My question is quite simple. Is a transaction implied within a SP when inserting into multiple tables within the same SP?

Something like this:
CREATE Procedure sp_Preset AS
INSERT INTO Header (..) VALUES (...)
INSERT INTO Detail (..) VALUES (...)
INSERT INTO Detail (..) VALUES (...)
INSERT INTO Detail (..) VALUES (...)
What if the 2nd insert into the Detail table fails for whatever reason, will all the above inserts be rolled back automatically or do I have to wrap this all into a transaction?

Einar
Semper ubi sub ubi.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform