@@IDENTITY, SCOPE_IDENTITY(), OUTPUT and other methods of retrieving last identity

It depends on what you are trying to do… @@IDENTITY Returns the last IDENTITY value produced on a connection, regardless of the table that produced the value, and regardless of the scope of the statement that produced the value. @@IDENTITY will return the last identity value entered into a table in your current session. @@IDENTITY … Read more