Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize


Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Displays the profile information for a statement. STATISTICS PROFILE works for ad hoc queries, views, and stored procedures.

Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database.

Topic link icon Transact-SQL Syntax Conventions


When STATISTICS PROFILE is ON, each executed query returns its regular result set, followed by an additional result set that shows a profile of the query execution.

The additional result set contains the SHOWPLAN_ALL columns for the query and these additional columns.

Column name



Actual number of rows produced by each operator


Number of times the operator has been executed

To use SET STATISTICS PROFILE and view the output, users must have the following permissions:

  • Appropriate permissions to execute the Transact-SQL statements.

  • SHOWPLAN permission on all databases containing objects that are referenced by the Transact-SQL statements.

For Transact-SQL statements that do not produce STATISTICS PROFILE result sets, only the appropriate permissions to execute the Transact-SQL statements are required. For Transact-SQL statements that do produce STATISTICS PROFILE result sets, checks for both the Transact-SQL statement execution permission and the SHOWPLAN permission must succeed, or the Transact-SQL statement execution is aborted and no Showplan information is generated.

Community Additions

© 2015 Microsoft