Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

resetting identity seed

Status
Not open for further replies.

foxitaly

Programmer
Jan 4, 2003
9
0
0
IT
I need to reset the identity seed to the starting value after deleting all records

How to ?

thanks
 
The only way I know of to do it is to drop the table and recreate it again.

If you have deleted all of the records this should be ok?
 
Following is the way to reset the identity seed after deleting all the records.

DBCC CHECKIDENT ('table name', RESEED, starting value-1)


 
From what I am reading ... "reset the identity seed to the starting value after deleting all records" means that you plan to DELETE all the records of this table SO ...

TRUNCATE TABLE MyTable

This will delete all the records from the table and WILL reset your Identity Seed value to it initial value, in most cases Zero.

Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top