Attack Work TM
Productivity tools to accomplish work faster
 
Username Password
   
Password help
Create new account
Skip Navigation Links.

MSSQL - Reseed an Identity value using DBCC CheckIdent

Steal This Site [Web Developer Blog]


To reseed the identity value of a column you can use the DBCC CheckIdent command. In the following example I reseed the identity column of a table called ExampleTable to 9. The reseed value has to be one lower than what you actually want the new record to have. So if you want a new record to be inserted with a value of 10 you must reseed the column with a value of 9.

Code:
DBCC CheckIdent(ExampleTable, reseed, 9)

Subscribe in a reader
Michael Khalili | Saturday, October 11, 2008
Comments
All guest comments are moderated.
Be the first to comment on this post
Post your comment
Guest Name* !
Email Address* !(Not published)
Website !
Comment*
!
*Required fields

Checkout my new project iPhone News and App Directory - Yappler.com


Terms of Service | Privacy Policy | Steal This Site
Attack Work and Voxback are trademarks of Hillside Holdings.