SQL Server: Script to find Identity Column of a Database

In this post, I am sharing one script to find all identity columns of a SQL Server Database.

We are using identity to generate auto_number in SQL Server table and this is also one of the common practice for all SQL Server Database Developer. This script will help us to find list of identity columns of a Database.

Below is a different script to find Identity columns:

First Script, using sys.objects and sys.identity_columns:

Second Script, using sys.tables and sys.identity_columns:

Third Script, using INFORMATION_SCHEMA.COLUMNS:

Anvesh Patel

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz