.NET Programming With Me

Resetting the id of a table having an identity column

I need to truncate the table having foreign keys. 
As this is not allowed, I deleted all the rows from the table and re-indexed the identity column of the table as this:


dbcc checkident('employee',reseed, 0)


where, employee is the name of table,
            reseed specifies that the current identity value should be changed,
and,    0 is the new seed value to use in reseeding the identity column


I did this in MS SQL Server 2005

No comments: