Logo 
Search:

SQL Server Articles

Submit Article
Home » Articles » SQL Server » System FunctionsRSS Feeds

IDENT_CURRENT Function

Posted By: Sarita Patel     Category: SQL Server     Views: 5168

This article explains about IDENT_CURRENT function in sql server with examples.

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.
  
Share: 

 
 
 

Didn't find what you were looking for? Find more on IDENT_CURRENT Function Or get search suggestion and latest updates.

Sarita Patel
Sarita Patel author of IDENT_CURRENT Function is from United States.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!