[dba-SQLServer]@@IDENTITY and SCOPE_IDENTITY

Susan Harkins harkins at iglou.com
Wed Mar 19 14:40:35 CST 2003


> @@IDENTITY will have the value of the new identity resulted from the
INSERT into the last table affected by this operation initiated directly or
indirectly by the current connection, thus - the scope of @@IDENTITY is the
connection.

=============Reading BOL, the phrase "the statement" is what I finally went
with -- meaning the function won't grab any other identity value outside the
statement that created it.

Thanks everyone.

Susan H.




More information about the dba-SQLServer mailing list