Back To Resources, Guides and Information

Reset Primary Key (ID) In Database

This was posted on 08/13/2010 and was filed in Tips And Tricks | (No Comments Yet)

I've been asked this numerous times, so I decided to post it. If you are databasing and find yourself either clearing your table, or moving a databased program from site to site, you may notice that clearing the table out does not reset the PRIMARY ID (UNIQUE ID), also known as auto increment, number. Execute this SQL to reset that number. Of course, you can change the number 1 to whatever you would like. So, if you want your ID to start at 10,000 use 10000. Cheers!

[code]ALTER TABLE tablename AUTO_INCREMENT = 1

Have I Helped You? Share Some Love!

Comments

» No Comments have been made on this. How about you start us off?

Comment On This

Browse By Category

Latest Posts

Advertising

© Max Morgan Design 2009 - 2012 | Page Generated In 0.21903 Seconds Using 42 MYSQL Queries