Re: Help - stored procedure not returning a recordset

From: Aaron Bertrand - MVP (aaron_at_TRASHaspfaq.com)
Date: 02/12/04


Date: Thu, 12 Feb 2004 09:55:34 -0500


> Remember to SET NOCOUNT OFF at the end of the proc too

Why? The setting only lasts for the scope of the proc (or the proc that
called it).

I always SET NOCOUNT ON and out of n stored procedures I have, not one
includes SET NOCOUNT OFF. Seems silly to enable it unless you are debugging
in query analyzer and can't be bothered with @@ROWCOUNT.

-- 
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


Relevant Pages

  • Re: Bcp and temp tables
    ... Here is the proc: ... bcp "SET FMTONLY OFF EXEC pubs.dbo.Kristoffer" queryout ... without SET NOCOUNT ON with the same results. ... > Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Simple Stored Procedure funktioniert mal und funktioniert mal nich
    ... Deine PROC gibt keinen RETURN-Value zurück sondern ... > Ein Return-Value in einer SP ist immer vom Datentyp int ... > Eine Return-Variable sollte in einer SP immer deklariert sein. ... > SET NOCOUNT OFF ...
    (microsoft.public.de.sqlserver)
  • Re: Simple Stored Procedure funktioniert mal und funktioniert mal nich
    ... Ein Return-Value in einer SP ist immer vom Datentyp int ... Eine Return-Variable sollte in einer SP immer deklariert sein. ... CREATE PROC dbo.myProc ... SET NOCOUNT OFF ...
    (microsoft.public.de.sqlserver)
  • Re: Stop DTS execution
    ... Include SET NOCOUNT ON as the first statement in your proc: ... CREATE PROC StorProc ... >>SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: I thought this was the one that worked?
    ... I guess you could debate whether that block is a closure, ... you've turned it into a Proc, so technically the Proc, rather than the ... not calling a Proc object derived from the ... _not_ the same scope as the scope where the block was created. ...
    (comp.lang.ruby)