Tuesday, October 14, 2008

Reset Identity in SQL Server 2005

Simple, yet i keep forgetting so to keep me reminded here it is. To reset identity to a table, so that everytime the surrogate keys start with 1 use the following command

DBCC CHECKIDENT('DimAssetUser', RESEED, 0)

This resets the identity to where its starting point, for the DimAssetUser table.