“SET NOCOUNT ON” vs “SET NOCOUNT OFF”


“SET NOCOUNT ON” vs “SET NOCOUNT OFF”

Here I would like to give a performance benefit at very small/basic level.

Use Pubs
SET NOCOUNT ON
SELECT au_lname FROM authors

Then, change from SET NOCOUNT ON to SET NOCOUNT OFF and run them.

Use Pubs
SET NOCOUNT OFF
SELECT au_lname FROM authors

Now what is the difference in both …..?

Basically at the left bottom tab. Click on Messages tab.

•SET NOCOUNT ON – the count is not returned
•SET NOCOUNT OFF – the count is returned

The output is returned faster If set it ON, it has a better performance

Advertisements

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: