SQL Flow Field Guide

OUTPUT inserted.*

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

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.