Re: SET NOCOUNT ON OPTION

From: Leon (vnality_at_msn.com)
Date: 10/20/04


Date: Wed, 20 Oct 2004 07:05:50 -0500

Thank Again!

"Cirrosi" <CirrosiN_O-S_P_A-M@fastwebnet.it> wrote in message
news:Dsqdd.15801$1q2.13733@tornado.fastwebnet.it...
>I tink that is better using it.
> It avoid that a procedure return more than one resultset, then it should
> execute quickly.
> Your sp don't return any resultset than you shoul use it.
>
> Excuse me for my bad english.
>
> "Leon" <vnality@msn.com> ha scritto nel messaggio
> news:ue62yDotEHA.3860@TK2MSFTNGP09.phx.gbl...
>> So is it good or bad to use SET NOCOUNT ON?
>> use my example sp for explanation. Thanks!
>>
>> "Cirrosi" <CirrosiN_O-S_P_A-M@fastwebnet.it> wrote in message
>> news:66pdd.15666$1q2.1609@tornado.fastwebnet.it...
>>>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: SET NOCOUNT ON OPTION
    ... It avoid that a procedure return more than one resultset, ... execute quickly. ... Your sp don't return any resultset than you shoul use it. ... > So is it good or bad to use SET NOCOUNT ON? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: recordset not opening even though query analyzer returns resul
    ... I'm convinced that VB can execute this complex SP. ... > only way i could get an earlier version of it to return in a recordset. ... > table into a cursor and add up th evalues of the ccjs based on values in ... >> execute a query the SQL engine returns a resultset. ...
    (microsoft.public.vb.database.ado)
  • Re: sqlCeResultSet readPrevious() method doesnt work always after a readAbsolut(currentPosition)
    ... On the desktop site the application is using MS Access. ... you now call ReadAbsoluteon rs2, a value of -1 is returned. ... When i execute a readPreviousafterwards, the resultset stays at the ...
    (microsoft.public.sqlserver.ce)
  • Re: jdbc query
    ... resultset is not getting executed. ... You can use the execute around idiom to tidy this lot up: ... final EmployerTeam employerTeam ... throws SQLException { ...
    (comp.lang.java.programmer)
  • Re: running complete transactions
    ... the resultset is retrieved from the first select statement, ... --into tableB or tableC before these next two select statements have ... I would be grateful if you could tell me if I have understood the API ... then execute a number of ResultSet ...
    (comp.lang.java.databases)