Re: SET NOCOUNT ON OPTION

From: Cirrosi (CirrosiN_O-S_P_A-M_at_fastwebnet.it)
Date: 10/20/04


Date: Wed, 20 Oct 2004 10:12:48 +0200

A sp is able to return motre than one resultset.
Even an update or an insert returns resultset, but in many case you don't
need that.
With nocount option you obtain only the resultset relative to last query.

"Leon" <vnality@msn.com> ha scritto nel messaggio
news:OVirIejtEHA.1332@TK2MSFTNGP10.phx.gbl...
> DOES SETTING NOCOUNT ON option affect my stored procedures and website
> performance in anyway within my asp.net application?
>
> When and when not to set SET NOCOUNT ON?
>
> I know what it does but not exactly where and when I want to use it.
>
> i.e.
> CREATE PROCEDURE GetAuthorization 2.0
> @Username Varchar( 20 ),
> @Password Varchar( 16 )
> as
> SET NOCOUNT ON
> declare @AccountID int
>
> set @AccountID = -1
> select @AccountID =
> case
> when Password = @Password and Active = 1 then AccountID
> when Password = @Password then -2
> else -3
> end
> from Account
> where Username = @Username
>
> return @AccountID
> go
>
>
>



Relevant Pages

  • Re: Stored Proc works everywhere except delphi - getting weirder
    ... I have no idea why SET NOCOUNT ON didn't help you. ... Here I quote a paragraph regarding my previous suggestion. ... an RDO Resultset object—it's related but not the same. ... put SET NOCOUNT ON in your stored procedure, in which case this packet ...
    (borland.public.delphi.database.ado)
  • Re: Returncode von Stored Proc in .NET-Code ermitteln
    ... Die SP gibt ein Resultset zurück, ... Und jedes SELECT sowie INSERT, UPDATE, DELETE liefert ohne SET NOCOUNT ON ... und die Daten hast Du sowieso im DataSet, ...
    (microsoft.public.de.german.entwickler.dotnet.datenbank)
  • Re: raise exception for any error from sql server
    ... Do you have SET NOCOUNT ON in your stored procedures? ... ADO as a separate resultset. ... SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Get Value
    ... you want the proc return value, while you are trying to fetch the first column of the resultset. ... I have following stored Procedure. ... SqlDataReader sqlDr; ... -- SET NOCOUNT ON added to prevent extra result sets from ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: SET NOCOUNT ON OPTION
    ... So is it good or bad to use SET NOCOUNT ON? ... >A sp is able to return motre than one resultset. ... >> DOES SETTING NOCOUNT ON option affect my stored procedures and website ... >> declare @AccountID int ...
    (microsoft.public.dotnet.framework.aspnet)

Quantcast