I am trying to find documentation on SQL Server where concept of scope is defined. I just want to understand it better.
I had been looking at scope_identity()
function and it says that @@identity
result and scope_identity()
result will differ in case there are triggers defined which insert records into another table with an identity column.
It seems scope_identity()
decides that insert in the trigger is in different scope. I want to see how that is determined/where it is documented...