SQL Flow Field Guide

OUTPUT deleted.*

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

captures old values

What changes

Input
before image of each affected row (UPDATE, DELETE, MERGE)
Output or change
OUTPUT stream

Syntax at a glance

OUTPUT DELETED.{ column_name | * }

Work example

A change review needs the before or after row image supplied by OUTPUT deleted.*.

Use a table variable when practicing DML output. Select only required columns and do not assume output row order.

Check your work OUTPUT deleted.*. The OUTPUT deleted.* 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.