SQL Flow Field Guide

DBCC OUTPUTBUFFER

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

diagnostic read

What changes

Input
a session's output buffer
Output or change
result set

Syntax at a glance

DBCC OUTPUTBUFFER ( session_id [ , request_id ] ) [ WITH NO_INFOMSGS ]

Work example

An authorized incident review needs output-buffer data for one session.

Confirm the session owner and protect the result because it can expose query or application data.

Check your work The output belongs to the intended session and sensitive values are not copied into the ticket.

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