MS SQL - Select Seed, Increment and Current Identity Values


/ Published in: SQL
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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'

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/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.