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.


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:

Author: dbtut

We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.

Leave a Reply

Your email address will not be published. Required fields are marked *