Reset the identity key for a column in SQL Server

Sometimes you need to reset an identity column value back to 0 (after inserting test-data and deleting the rows again for example). Of course, generally you shouldn’t change primary keys and of course primary key values doesn’t matter at all, but for the case you want to start with an new idenity 1 for the first row then simply use:

DBCC CHECKIDENT('YOURTABLENAME', RESEED, 0)