SQL Flow Field Guide

DBCC OPENTRAN

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

DBCC OPENTRAN: administrative check or maintenance

What changes

Input
database, table, index, cache or server state named in the command
Output or change
messages or result sets; maintenance forms change storage, caches or metadata

Syntax at a glance

DBCC OPENTRAN [ ( [ database_name | database_id | 0 ] ) { [ WITH TABLERESULTS ] [ , [ NO_INFOMSGS ] ] } ]

Work example

A transaction log cannot truncate and the team needs the oldest active transaction.

Record the database and transaction details, then correlate them with session and log backup history.

Check your work The identified transaction explains the log hold or the incident moves to another cause.

Open Microsoft Learn for full syntax, permissions, and details for your version.