Reputation: 20002
while the development of websites we use the database to test & all... which consumes a lot from auto generated (auto increment) attributes series... how to reset everything...
Upvotes: 3
Views: 658
Reputation: 2877
Another possibility, avoiding transactions and resetting the autoincrement counter could be to combine the select to get the next available id and the insert itself;
INSERT INTO tablename (id, somefield1, somefield2) SELECT max(id)+1, 'test', 5 FROM tablename
Upvotes: 0
Reputation: 179994
Assuming you're deleting the records when you're done testing, a TRUNCATE
command will delete all records and reset the autoincrement value.
Upvotes: 4