How can I reset an auto generated number back to start from 1 again.
I made a test table, now to implement the table I need to start the counter back from 1.
The field that I am trying to reset is CustID
It is a primary key for a table and it is set as an Indentity with Increment 1.
Thanks
Taimur"Truncate table" will reset the identity counter to the original seed value.|||or you could use the following (where TestTable is the name of the table):
DBCC CHECKIDENT (jobs, TestTable, 1)|||Sorry... just to correct the previous posting:
DBCC CHECKIDENT (TestTable, RESEED, 1)|||Thanks Iwaker. This worked perfect. :)
Originally posted by lwaker
Sorry... just to correct the previous posting:
DBCC CHECKIDENT (TestTable, RESEED, 1)sql
Showing posts with label implement. Show all posts
Showing posts with label implement. Show all posts
Monday, March 26, 2012
Friday, March 23, 2012
Re-set identity field
Hi:
I created a small SQL Express database/ASP.net/C# application and in the learning process. Before I implement it I would like to re-set autonumber / identity field back to 1. Also, I need to start with the blank database. I am not sure how to approach that?
Can you assist?
Thanks
http://www.mssqlcity.com/FAQ/Devel/reset_identity_column.htm
Subscribe to:
Posts (Atom)