|
which one is better to reset @@identity column. Lets have a discussion.
|
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Posted Oct 15, 2010, 10:08 PM
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.