Finding all the identity columns and the last inserted values in your Database

SELECT IC.NAME AS COLUMNAME,ST.NAME AS TABLENAME,IC.SEED_VALUE,IC.INCREMENT_VALUE,IC.LAST_VALUE

FROM SYS.IDENTITY_COLUMNS IC INNER JOIN SYS.TABLES ST ON ST.OBJECT_ID = IC.OBJECT_ID

WHERE IC.IS_IDENTITY = 1

Advertisements

One thought on “Finding all the identity columns and the last inserted values in your Database

  1. Marta says:

    I blog frequently and I seriously thank you for your content.
    The article has really peaked my interest. I will bookmark your site and keep checking for new details
    about once per week. I opted in for your Feed too.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s