Aknot
asked on
Reset, renew or change the AutoIncrement values
Hi all MySQL devs...
I need to change the AutoInc values to several tables in my MySQL server.
This to several reasons. But I can not find any pointers how to make this possible.
I have, for example a table starting at 1 (id:1) and it' s ending at 98 (id:98).
Now I need this values to starting at 5001 and upwards, eg:
5001, 5002, 5003, 5004 and so on...
When inserting a new id, I need the counter to continue after 5098, and that would be 5099 in this case.
I need the counter to continue working as normal after the changes to new autoincrement series of numbers.
Hope you understand what I mean =)
Im using the Win32 Ed and MySQL Front as editor. I can however access the
mysql-nt.exe if this is needed.
Best regards Pelle in Sweden...
I need to change the AutoInc values to several tables in my MySQL server.
This to several reasons. But I can not find any pointers how to make this possible.
I have, for example a table starting at 1 (id:1) and it' s ending at 98 (id:98).
Now I need this values to starting at 5001 and upwards, eg:
5001, 5002, 5003, 5004 and so on...
When inserting a new id, I need the counter to continue after 5098, and that would be 5099 in this case.
I need the counter to continue working as normal after the changes to new autoincrement series of numbers.
Hope you understand what I mean =)
Im using the Win32 Ed and MySQL Front as editor. I can however access the
mysql-nt.exe if this is needed.
Best regards Pelle in Sweden...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>I also need a way to change the already existing autoincrement values/numbers<<
UPDATE YourTable SET ID=ID+5000
Is this not what you wanted ?
Peerapol
UPDATE YourTable SET ID=ID+5000
Is this not what you wanted ?
Peerapol
ASKER
Yeas of course it was =) Thank you...
ASKER