Specifying auto number seed and step values in MySql when using the Create Table command

How can you specify the seed and step values when creating an autonumber using the create table command?

Thanks

Fred
fred2k3Asked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
http://dev.mysql.com/doc/refman/5.0/en/create-table.html

you can only specify a starting value (seed), mysql does not support step values different from 1:
create table yourtable ( auto_field  INT AUTO_INCREMENT , .... ) AUTO_INCREMENT = 2

0
 
todd_farmerCommented:
You actually can control this behavior - but not at the CREATE TABLE level.  You can set server parameters (auto_increment_increment and auto_increment_offset) that control this:

http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html

Obviously, this impacts all tables.

Hope that helps.
0
 
fred2k3Author Commented:
cheers guys
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.