October 17, 2007 at 1:04 pm
Comments posted to this topic are about the item What would the following statement output in Query...
July 16, 2009 at 11:14 pm
I know it's very old question but i think explanation here is wrong. Output is 0 not because there's no rows updated but because @@rowcount holds number of rows affected by the last operation. Rollback (or commit) reset @@rowcount to 0.
ptr
September 16, 2010 at 11:08 am
Piotr Ryszkowski (7/16/2009)
I know it's very old question but i think explanation here is wrong. Output is 0 not because there's no rows updated but because @@rowcount holds number of rows affected by the last operation. Rollback (or commit) reset @@rowcount to 0.ptr
You are right Piotr.
BOL says: Statements such as USE, SET <option>, DEALLOCATE CURSOR, CLOSE CURSOR, BEGIN TRANSACTION or COMMIT TRANSACTION reset the ROWCOUNT value to 0.
October 11, 2012 at 9:00 am
good question...was aware of the functionality of row_count with roll back...
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy