During the development phase I frequently come across the need of deleting a table and resetting the IDENTITY column back to 0.
The truncate statement does reset the identity seed to its original value; however, truncate is now allowed on a table where the columns are being referenced as foreign key. You could remove the foreign key reference and truncate the table and then recreate the foreign key but that's a messy way of getting around it. I normally use following two queries:
delete from SomeTable
DBCC CHECKIDENT ("SomeTable", RESEED, 0)
Having said that, if your table is very large it probably will be quicker to drop the foreign key ref and then truncate and recreate the foreign key. But for smaller size table the above mentioned queries are much cleaner way of achieving this requirement.
784c7e1c-8350-4d39-9e0c-3e4574fbfe83|0|.0