Re: SET NOCOUNT ON OPTION

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Adam Machanic (amachanic_at_hotmail._removetoemail_.com)
Date: 10/19/04


Date: Tue, 19 Oct 2004 09:13:32 -0400


"Philippe [MS]" <ptrotin@online.microsoft.com> wrote in message
news:uPgqYjbtEHA.3460@TK2MSFTNGP15.phx.gbl...
>
> UPDATE ...
> IF @@ROWCOUNT = 0
> BEGIN
> INSERT ...
> END
>
> Therefore, you need to have the NOCOUNT set to OFF

    Phil,

    @@ROWCOUNT and the NOCOUNT option are mutually exclusive:

    CREATE TABLE #abc(def INT)

    SET NOCOUNT ON

    INSERT #abc (def)
    VALUES (1)

    SELECT @@ROWCOUNT