Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
janets20
Starting Member
12 Posts |
Posted - 2010-06-19 : 22:10:51
|
Hi, In which scenario does @@identity will fail.Pls explain in detail.Diff bet Scope_Identity vs @@identityRegardsJane |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
niechen861102
Starting Member
9 Posts |
Posted - 2010-06-20 : 22:57:11
|
spam removed |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2010-06-21 : 02:32:53
|
@@identity is global. When you ask for @@identity you might get an identity value that was inserted in another statement/stored procedure while scope_identity always gives you the last identity in the current scope. Therefore you shuld always use scope_identity...- LumbagoMy blog (yes, I have a blog now! just not that much content yet) -> www.thefirstsql.com |
|
|
|
|
|