Solved

SET NOCOUNT ON - OFF - ON - OFF....

Posted on 2001-09-12
4
1,351 Views
Last Modified: 2007-12-19
Not really a question here...
Well, it is.

When i go to MSDN there is an article that states
that when you want to use a temporary table created by a stored procedure with ADO...
You should place SET NOCOUNT ON before any action is taken, they don't mention SET NOCOUNT OFF.

But then in SQL Books Online is stated that you
always should place SET NOCOUNT OFF after the handling...

What do these commands actually really do etc...
0
Comment
Question by:wvandeneede
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Accepted Solution

by:
deestuar earned 10 total points
ID: 6476650
I normally do both for good practise if you don't do this you can get problems when retrieving data with record sets
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6476670
I do actually only put it in front (SET NOCOUNT ON),
when my stored procedures are returning empty recordsets which are skipped that way when reading from VB+ADO.
When testing some scripts with some insert statments, i use it too, but for the rest i don't...
CHeers
0
 
LVL 6

Expert Comment

by:curtis591
ID: 6476830
Set nocount on stops the message indicating the number of rows affected by a sql statement from being returned.  If you go to query analyzer and run the statement you will not get the message 5 rows affected.  I have read a number of articles that claim that by setting nocount on in your procedures you can really get a performance boost but I have never really tested this theory.
0
 

Author Comment

by:wvandeneede
ID: 6482650
Since this wasn't really a question, i don't know
who to give the points to?

I hope everyone will be satisfied when i just give
them to the first reaction

measly little 10 points anyway ;)

CyA WeZ
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question