OK, if you read @@ERROR then @@ROWCOUNT is reset.
If you read @@ROWCOUNT then @@ERROR is reset.
If you want to know the value of both @@ERROR and @@ROWCOUNT then it might seem like you're kind of shagged.
Well, you would be, except if you read them both at the same time! ;)
Like so:
SELECT @err = @@ERROR, @rc = @@ROWCOUNT
Just nicely thank you.
John.
(If you haven't danced yet, then what the fuck did you come for!?)
This one was handy too:
http://vyaskn.tripod.com/differences_between_set_and_select.htm
John.