Posted By

SocialCocoa on 11/03/11


Tagged

mssql Value seed identity increment


Versions (?)

MS SQL - Select Seed, Increment and Current Identity Values


 / Published in: SQL
 

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/

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

  1. SELECT
  2. IDENT_SEED(TABLE_NAME) AS Seed,
  3. IDENT_INCR(TABLE_NAME) AS Increment,
  4. IDENT_CURRENT(TABLE_NAME) AS Current_Identity,
  5. TABLE_NAME
  6. FROM
  7. INFORMATION_SCHEMA.TABLES
  8. WHERE
  9. OBJECTPROPERTY(OBJECT_ID(TABLE_NAME), 'TableHasIdentity') = 1 AND
  10. TABLE_TYPE = 'BASE TABLE'

Report this snippet  

You need to login to post a comment.