The below three built-in functions can be used to get the identity of the mostly added record. @IDENTITY It returns the last identity value generated for any table in the current session, across all scopes. Let me explain this... suppose we create an insert trigger on table which inserts a row in another table with generate an identity column, then @@IDENTITY returns that identity record which is created by trigger.
Asp.Net,C#.Net,SQL Server Articles, Source Codes and Examples