Re: SET NOCOUNT ON

From: Aaron Bertrand - MVP (aaron_at_TRASHaspfaq.com)
Date: 05/19/04


Date: Wed, 19 May 2004 12:30:18 -0400

It prevents n row(s) affected messages from interfering with output. In
Query Analyzer, this means less clutter in the results pane; in ADO it can
mean that the message isn't incorrectly interpreted as a result set.

FWIW, I use SET NOCOUNT ON in every single stored procedure I write.

-- 
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Reza Alirezaei" <anonymous@discussions.microsoft.com> wrote in message
news:eh32W3bPEHA.3100@TK2MSFTNGP10.phx.gbl...
> what dose this line at the beginign of an stored procedure do??
> SET NOCOUNT ON
>
>
> Thanks in advance for your time.
>
>


Relevant Pages

  • Re: Can someone explain why my code is not working
    ... posting to a class ADO group Also, ... am unable to get a return value from a stored procedure in .NET using ... ADO: Add "SET NOCOUNT ON to the body of your procedure, ...
    (microsoft.public.data.ado)
  • Re: Stored procedure executes twice
    ... The SET NOCOUNT issue is an unrelated issue to yours (judging by your ... duplicate executions. ... >> Do your stored procedures contain SET NOCOUNT ON? ... >> used ADO); try changing the lock types to see if that helps. ...
    (microsoft.public.sqlserver.programming)
  • Re: Adding date to parameter
    ... ClaimedDate does appear to have a properly formatted date. ... I am using the following stored procedure: ... -- SET NOCOUNT ON added to prevent extra result sets from ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Using DTS to Insert 1 Second record for every second in a month?
    ... Okay...so you basically need a calendar table by seconds. ... And yes that will perform pretty fast for the type of query ... >set NoCount OFF ... >This stored procedure took about 21 minutes. ...
    (microsoft.public.sqlserver.dts)
  • RE: What stored procedures call this stored procedure?
    ... this in the wrong way - I have the ID of a stored procedure and I'm looking ... > set nocount on ... > declare @rv int ...
    (microsoft.public.sqlserver.programming)