Reset auto increment on a table


/ Published in: SQL
Save to your folder(s)

If you are deleting all the rows in a table and you also want to reset the values that will get used by auto increment, this is how to do it.


Copy this code and paste it in your HTML
  1. ALTER TABLE tbl AUTO_INCREMENT = 1;

URL: http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.