Obtaining the Last Inserted Identity in Any SQL Server Session

added by BlackWasp
11/9/2012 5:27:45 PM

0 Kicks, 58 Views

It is a common task to obtain the last inserted identity value for a SQL Server table for the current connection, with @@IDENTITY, or for the current scope, with SCOPE_IDENTITY. However, it is also possible to find the latest identity inserted by any session.