Is the @@rowcount personal ?

  • Is it possible that another user or another connection changes my @@rowcount value before I can read it ?  

  • No.

     

    But keep in mind that ANY statement (even print '' or set @MyVar = 4) made after the query will either reset it to 0 or to the new number of rows affected.

  • Thanks for your time Ninja's_RGR'us !

    Wilco.

  • Happy to help.  Come back anytime you have another question.

  • Actually, a trigger that inserts into a table with an IDENTITY column will 'mask' the identity you are expecting.

    To limit the value returned to the table within the scope of the DML you may want to investigate SCOPE_IDENTITY()

  • That's a good point but what does the identity have to do with rowcount?

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply