OUTPUT ... INTO table
persists captured rows
What changes
- Input
- inserted/deleted streams
- Output or change
- a table or table variable (no enabled triggers, no FK either side)
Syntax at a glance
OUTPUT <dml_select_list> INTO { @table_variable | output_table } [ ( column_list ) ]
Work example
A change review needs the before or after row image supplied by OUTPUT ... INTO table.
Use a table variable when practicing DML output. Select only required columns and do not assume output row order.
Check your work OUTPUT ... INTO table. The OUTPUT ... INTO table values match the affected rows and any captured rows go to the intended result or table variable.
Open Microsoft Learn for full syntax, permissions, and details for your version.