@@IDENTITY and SCOPE_IDENTITY()
@@IDENTITY and SCOPE_IDENTITY() will return the last inserted identity value in the current session but in different scenarios they can each return different values.
While both @@IDENTITY and SCOPE_IDENTITY return the last identity value generated in any table in the current session, SCOPE_IDENTITY() will return the value only within the current scope (a [...]
