Using INSERT / OUTPUT in a SQL Server Transaction
Frequently I find myself in situations where I need to insert records into a table in a set-based operation wrapped inside of a transaction where secondarily, and within the same transaction, I spawn-off subsequent inserts into related tables where I need to pass-in key values that were the outcome of the initial INSERT command. Thanks to a Transact/SQL enhancement in SQL Server, this just became much easier and can be done in a single statement... WITHOUT A TRIGGER!
Join SQL Backup’s 35,000+ customers to compress
and strengthen your backups
"SQL Backup will be a REAL boost to any DBA lucky enough
to use it." Jonathan Allen.
Download a free trial now.