Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting and selecting at the same time
Message
From
23/09/2013 10:24:07
 
 
To
23/09/2013 10:21:45
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Desktop
Miscellaneous
Thread ID:
01583879
Message ID:
01583889
Views:
37
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform