RSS

Reset AutoIncrement in SqlServer after Delete

15 Oct

Issue the following command to reseed mytable to start at 1:

DBCC CHECKIDENT (mytable, RESEED, 1)

Read about it in the Books on Line (BOL, SQL help). Also be careful that you don’t have records higher than the seed you are setting.

Referenced by: http://stackoverflow.com/questions/510121/reset-autoincrement-in-sqlserver-after-delete

Advertisements
 
Leave a comment

Posted by on October 15, 2011 in SQL Server

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: