«

»

May 05 2010

Print this Post

MS SQL resetting the auto increment

DBCC CHECKIDENT(‘test’, RESEED, 10001) ;

where ‘test’ is the tables name we want to reset.

There is a trick if you already have some date into your table your next inserting will start from 0.

I’ve tested this and it work a treat.

Found here: http://weblogs.asp.net/stoianbucovich/archive/2008/03/03/ms-sql-resetting-the-auto-increment.aspx

Enjoy :-)

Permanent link to this article: http://ramblinggeek.co.uk/2010/05/ms-sql-resetting-the-auto-increment/

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>