Site icon Database Tutorials

How To Get the Last Generated Identity Value For a Table or View(IDENT_CURRENT Function)

 

The use of “Auto Increment Identitiy Column” in tables is common. In some cases, we may want to find the last Identitiy value generated. In this article, we will use the IDENT_CURRENT function to find the last generated identitiy value.

Example:

First, we create a table with the help of the following script and add a few records into this table.

Find Last Generated identity value with IDENT_CURRENT function:

Exit mobile version