472,103 Members | 1,032 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,103 software developers and data experts.

Set auto increment start value to 1000?

Hi

Is there at way to reset a table and set the auto increment value to 1000?

/Brian Bendtsen
May 5 '06 #1
2 118050
Brian Bendtsen wrote:
Is there at way to reset a table and set the auto increment value to 1000?


truncate tablename;
insert into tablename (id) values(999);
delete from tablename where id=999;
May 5 '06 #2
JJ
To start with an AUTO_INCREMENT value other than 1, you can set that value
with CREATE TABLE or ALTER TABLE, like this:

mysql> ALTER TABLE tbl AUTO_INCREMENT = 1000;

"Brian Bendtsen" <br*@mentor-it.dk> wrote in message
news:44***********************@dread15.news.tele.d k...
Hi

Is there at way to reset a table and set the auto increment value to 1000?

/Brian Bendtsen

May 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Tom | last post: by
mmarif4u
reply views Thread by mmarif4u | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.