October 31, 2014

Reseeding SQL Server Identity

Reseeding / Resetting identity value in SQL Server 2005

You can reseed indentity values, that is, to have identity values reset or start at new predefined value by using DBCC CHECKIDENT.  For example, a table named nwdsTable can be reseeded with the indentity column to 3.

 dbcc checkident (nwdsTable, reseed, 3)

 To reseed tables to start with identity of 1 with next insert , reseed table's identity to 0.  Identity seed is what the value is currently at, meaning that the next value will increment the seed and use that.  However, keep in mind  if you set the identity seed below values that you currently have in the table, that you will violate the indentity column's uniqueness constraint as soon as the values start to overlap

Services
Other Services
About Us
Location
Custom Software Applications
Database Programming
Web Development and Design

Search Engine Optimization
Report Writing
IT Consulting
MS Excel Consulting
MS Access Programming
FAQs
Contact
Request a Quote
Free SMS Pro Quote
Alaska Web Design Company
Email: chowell@nwds-ak.com
Phone: 907-227-1676
cash, check, credit card, invoice, paypal
2627 C Street
Anchorage, AK 99503