Reseed an Identity Column
Sometimes identity columns must be reseeded. A good example is when merging data from a couple of different data sources. There is a DBCC command that makes this task easy.
DBCC CHECKIDENT (<table name>, RESEED, <new value>
To find what existing identity column values are, a simple query can be written off the sys.identity_columns system view.
DBCC CHECKIDENT (<table name>, RESEED, <new value>
To find what existing identity column values are, a simple query can be written off the sys.identity_columns system view.
SELECT OBJECT_NAME(object_id) AS [Table],
[name] AS [column],
seed_value,
last_value
FROM sys.identity_columns
ORDER BY 1


This page added to Google cache Cached: http://google.com/search?q=cache:http://mysqlserverblog.com/2007/10/26/reseed-an-identity-column.aspx?ref=rss&ei=AFQjCNHajN_OX0kgxzx7UGA1yBffree PoRndfWq
Reply to this
your article is so informative and interesting. nice shared.
Reply to this
Many thanks to the author. It is incomprehensible to me now, but in general, the usefulness and significance is overwhelming.
Reply to this