Return to Snippet

Revision: 52857
at November 3, 2011 03:38 by SocialCocoa


Initial Code
SELECT 
   IDENT_SEED(TABLE_NAME) AS Seed,
   IDENT_INCR(TABLE_NAME) AS Increment,
   IDENT_CURRENT(TABLE_NAME) AS Current_Identity,
   TABLE_NAME
FROM 
   INFORMATION_SCHEMA.TABLES
WHERE 
   OBJECTPROPERTY(OBJECT_ID(TABLE_NAME), 'TableHasIdentity') = 1 AND 
   TABLE_TYPE = 'BASE TABLE'

Initial URL
http://blog.sqlauthority.com/2007/04/23/sql-server-query-to-find-seed-values-increment-values-and-current-identity-column-value-of-the-table/

Initial Description
Thanks to  Pinal Dave (http://blog.SQLAuthority.com).

Initial Title
MS SQL - Select Seed, Increment and Current Identity  Values

Initial Tags

                                

Initial Language
SQL