$action (MERGE OUTPUT)
per-row action label
What changes
- Input
- the MERGE branch taken per row
- Output or change
- nvarchar(10): INSERT, UPDATE or DELETE
Syntax at a glance
OUTPUT $action, ...
Work example
A change review needs the before or after row image supplied by $action (MERGE OUTPUT).
Use a table variable when practicing DML output. Select only required columns and do not assume output row order.
Check your work $action (MERGE OUTPUT). The $action (MERGE OUTPUT) 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.