Home > SQL Server > SQL SERVER – SET STATISTICS PROFILE – TSQL – SET Statement

SQL SERVER – SET STATISTICS PROFILE – TSQL – SET Statement


SET STATISTICS PROFILE : This set statements used to get the query output (result set) and query plan execution information with row count value. There are other set statements such as SHOWPLAN_TEXT, SHOWPLAN_XML and SHOWPLAN_ALL are also used to get the query execution plan but it will not return the result set as part of the output. This is very useful when we need both result set and execution plan information for performance tuning.

Usage

SET STATISTICS PROFILE ON

or

SET STATISTICS PROFILE OFF

Example

Executing a query when SET STATISTICS PROFILE is ON.

pic1Graphical execution plan look like this

pic2

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: