IDENT_CURRENT function returns last identity value generated for a specified table in any session and any scope.
Syntax of IDENT_CURRENT Function :
IDENT_CURRENT ('table_name')
table_name is a name of the table. It is of type varchar.
Return type of IDENT_CURRENT function is a sql_variant.
Examples of IDENT_CURRENT Function :
Example 1 : Use of IDENT_CURRENT function in select clause
SELECT IDENT_CURRENT ( 'Products' )
Output
77
Above example returns last identity value generated for products table.