IDENTITY column¶
It is nothing but auto increment of the column
syntax:¶
1 2 3 4 5 | |
How to retrive last identity column values¶
1.Scope_identity:¶
Returns the last identity value inserted into an identity column in the same scope. A scope is a module: a stored procedure, trigger, function, or batch. Therefore, if two statements are in the same stored procedure, function, or batch, they are in the same scope.
1 | |
@@Identity:¶
Is a system function that returns the last-inserted identity value in any table in current session
1 | |
ident_current:¶
returns the last identity value generated for a specific table
1 | |