i was wondering if it was possible to reset the increment back to 0, once all the data in the table is deleted??
thanks in advance
g
| SitePoint Sponsor |
i was wondering if it was possible to reset the increment back to 0, once all the data in the table is deleted??
thanks in advance
g


I believe it is:
Code:ALTER TABLE stuff AUTO_INCREMENT=1;
If all the data is deleted:
http://dev.mysql.com/doc/mysql/en/TRUNCATE.htmlCode:TRUNCATE TABLE whatever;
thanks, is it possible to this without deleting the data do you kow?


That will reset the AUTO_INCREMENT value to 1 or what ever the highest current value in the table is +1;Code:ALTER TABLE stuff AUTO_INCREMENT=1;
Bookmarks