Monitoring Databases  «Prev 

dbcc checkident Syntax in SQL-Server

Check Indent
DBCC CHECKIDENT
Check Indent

  1. Table_name – The name of the table to check.
  2. Noreseed – Tells SQL Server to only check the value without fixing it.
  3. RESEED – Tells SQL Server to fix the identity, default value.
  4. New_reseed_value – This is the value to use when reseeding the table.

DBCC CHECKIDENT ('table'):

Verifies the consistency of the current identitycolumn value and the identity column for a specifi c table. If a problem exists, the next value for the identity column is updated to correct any error. If the identity column is broken, the new identity value violates a primary key or unique constraint and new rows cannot be added to the table. You can also use this command to reseed the current identity value by using the RESEED option and a new_reseed_value. The following code demonstrates the use of the DBCC CHECKIDENT command. If it is needed, this command resets the current identity value of the Employee table in

the AdventureWorks2012 sample database:
Use AdventureWorks2012;
DBCC CHECKIDENT ("HumanResources.Employee");