OUTPUT inserted.*
captures new values
What changes
- Input
- after image of each affected row (INSERT, UPDATE, MERGE), including identity and default values
- Output or change
- OUTPUT stream
Syntax at a glance
OUTPUT INSERTED.{ column_name | * }
Work example
A change review needs the before or after row image supplied by OUTPUT inserted.*.
Use a table variable when practicing DML output. Select only required columns and do not assume output row order.
Check your work OUTPUT inserted.*. The OUTPUT inserted.* 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.