SET STATISTICS IO

Transact-SQL Reference

Transact-SQL Reference

SET STATISTICS IO

Causes Microsoft® SQL Server™ to display information regarding the amount of disk activity generated by Transact-SQL statements.

Syntax

SET STATISTICS IO { ON | OFF }

Remarks

When STATISTICS IO is ON, statistical information is displayed. When OFF, the information is not displayed.

After this option is set ON, all subsequent Transact-SQL statements return the statistical information until the option is set to OFF.

There are five output items.

Output item Meaning
Table Name of the table.
scan count Number of scans performed.
logical reads Number of pages read from the data cache.
physical reads Number of pages read from disk.
read-ahead reads Number of pages placed into the cache for the query.

The setting of SET STATISTICS IO is set at execute or run time and not at parse time.

Permissions

SET STATISTICS IO permissions default to all users.

See Also

SET

SET SHOWPLAN_ALL

SET STATISTICS TIME