• Dave's right. Here's a good practice tip:

    @@ROWCOUNT changes with each new SET or SELECT, so if you want to hold on to the value for a while, be sure to store it in the variable of your choice.

    -- always returns a @@ROWCOUNT of 1, because of the SET statement

    declare @DoNothing int

    select name from sys.databases

    SET @DoNothing = 1

    select @@ROWCOUNT as rowsReturned

    go

    -- saves the rowcount in @rc for later reference

    declare @rc int

    declare @DoNothing int

    select name from sys.databases

    SET @rc = @@ROWCOUNT -- save for later

    set @DoNothing = 1

    select @rc as rowsReturned

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills