Code Code |
which one is better to reset @@identity column. Lets have a discussion.
Code Code |
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Posted Oct 15, 2010, 6:08 PM EDT
Here you go : TRUNCATE TABLE and DBCC CHECKIDENT
Reseeding an identity column is a common task, but you must know the basics or you might get into trouble. Specifically, an identity column can generate duplicate values. Knowing when and why is the key to keeping an identity column in check.
DBCC CHECKIDENT (TableName, RESEED, ReseedValue) yields unexpected results when all rows removed from a table
http://blogs.x2line.com/al/archive/2003/12/13/158.aspx
http://nathondalton.wordpress.com/2010/08/12/delete-table-data-reset-identities-in-sql/
http://blog.sqlauthority.com/2007/03/15/sql-server-dbcc-reseed-table-identity-value-reset-table-identity/
http://blogs.techrepublic.com.com/datacenter/?p=406
Hope this helps you.