Last generated Identity column value in SQL Server
·
SCOPE_IDENTITY () – Same session and the same
scope. Ex:- select SCOPE_IDENTITY()
·
@@IDENTITY – Same session and across any scope. Ex:- select @@IDENTITY
·
IDENT_CURRENT(‘TableName’) – Specific table
across any scope and any session. Ex:- select IDENT_CURRENT('test')