Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting and selecting at the same time
Message
De
23/09/2013 10:24:07
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Desktop
Divers
Thread ID:
01583879
Message ID:
01583889
Vues:
36
Big Thank You!

Glad that helped....the OUTPUT is a nice feature to "get at" what got inserted, and also what got updated.

When you're doing an UPDATE, you can OUTPUT from the DELETED system table to "get at" the state of updated rows before the update (old values), and also OUTPUT from the INSERTED system table to "get at" the state of the rows after the UPDATE.

Basically, Microsoft took the INSERTED and DELETED system tables - previously available only in a TRIGER, and made them available in an OUTPUT statement that you can slap onto an INSERT/UPDATE/DELETE. It's a cool feature.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform