Using @@ROWCOUNT or Similar function

  • Think of it this way:

    The update command is only updating one records at a time. First it updates there first records. After updating the first record @Hellobye gets set to 1, since the value of v1 happens to be 1 on the first records. Now the second record gets update, so now @hellobye gets set to the value in @hellobye (which is 1) , since v1 is null. The third records gets update, so now @hellobye gets set to 3, since v1 on the third records is 3, and, so, and so. Make since.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • Yes it does now. I had no idead that you could 'get' a value with an update statement.

  • This one was a new one on me as well. Think we should all say "...Prakash, a real guru ... "

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

Viewing 3 posts - 16 through 17 (of 17 total)

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