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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to reset the seed of identity column?

Status
Not open for further replies.

soyo20

IS-IT--Management
Jan 5, 2003
9
CN
I create a table in my DB which has a identity column.
I insert many row and the value of identity increase correctly. Now I want to delete all the rows and reset the identity value to its seed to restart. I failed. Can you instruct me HOW TO RESET THE SEED OF THE IDENTITY COLUMN?

Thank you very much
 
Use TRUNCATE TABLE tablename to delete all the rows - this will reset the identity seq number as well.


 
You could use DBCC CHECKIDENT('tablename', RESEED, 0)

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top