SQL Flow Field Guide

SET STATISTICS IO

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

adds I/O counters per table to messages

What changes

Input
none
Output or change
session state

Syntax at a glance

SET STATISTICS IO { ON | OFF }

Work example

A tuning review needs the measurement supplied by SET STATISTICS IO for one read-only query.

Capture a baseline and run the same query and parameters before and after a single change. Turn the setting off when the capture ends.

Check your work SET STATISTICS IO. The SET STATISTICS IO output is tied to the measured query and the setting is off for the next user of the session.

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