Resetting the primary key to 1
<p>I have a script for microsoft sql server database which has hundreds of tables and tables contains data as well. This is the database of a web application.what I want to do is to delete the previous records and reset the primary key to 1 or 0.
I have tried </p>

<pre><code>`DBCC CHECKIDENT ('dbo.tbl',RESEED,0); `
</code></pre>

<p>but it does not work for me as in most of the tables the primary key is not identity.</p>

<p>I can not truncate the table as its primary key is being used as FK in many other tables.
I have also tried to add the identity specification in  the primary key of the table and run the checkident query and then changing it back to non-identity spec, but after adding the record again it starts from where it left.
Making changes in the code is not an option for me.</p>

<p>please help.</p>