March 26, 2013 at 2:00 pm
I came to add exactly the same point - SCOPE_IDENTITY() would guarantee that the just-inserted rows' newly-generated IDENTITY value would be unique.
March 26, 2013 at 4:11 pm
alishahryar (3/26/2013)
I came to add exactly the same point - SCOPE_IDENTITY() would guarantee that the just-inserted rows' newly-generated IDENTITY value would be unique.
As mentioned earlier, the scope_identity function has been known to generate incorrect values at times (when queries make use of parallel execution plans). Refer to this link for more information --> http://support.microsoft.com/kb/2019779
Ajit Ananthram
Blog - http://ajitananthram.wordpress.com
March 26, 2013 at 4:19 pm
OK, that's good information regarding the bug affecting @@IDENTITY and SCOPE_IDENTITY(). According to the article you provided, the bug is fixed in 2008 R2 SP 1 and above. Thanks for pointing this out.
April 9, 2013 at 5:05 pm
NBSteve: Wow. That was so kind of you to take the time to write that out. Not wordy in the slightest. Instead, it was *clear.* I greatly appreciated it!
(Also thank you to the original author. I enjoy articles that explains a person's process/thinking. And also thank you to Paul for posting your interesting solution.)
Viewing 4 posts - 61 through 64 (of 64 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