Home > SQL Server > SQL SERVER – SET STATISTICS TIME – SET Statement

SQL SERVER – SET STATISTICS TIME – SET Statement


SET STATISTICS TIME : This set statement is used to get the total time required to parse, compile and execute a SQL statement. The time is represented as milliseconds.

We may not get an accurate result (process time) if we enabled the lightweight pooling option.

The cpu column in the sysprocesses table is only updated when a query executes with SET STATISTICS TIME ON.

Example

pic1when Statistics Time is ON,

pic2SET STATISTICS TIME Usage

SET STATISTICS TIME ON

or

SET STATISTICS TIME OFF

Example

pic3This set statement is another important statement in the SQL query performance tuning.

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: