At 9:26 PM -0600 2000-02-04, Josh Abrams wrote:
>Sorry, let me clarify somewhat.
>
>What I meant to say was that the _default_ value seems to be 0, even
>though I specify an initial default of 1000 when creating or modifying the
>field.
>
>Is it possible to set the default value to anything other than 0?
Yes, it is, but you must be running MySQL 3.23. To set the initial
AUTO_INCREMENT value, add a clause to the end of your CREATE TABLE
statement:
CREATE TABLE tbl_name( column declarations ) AUTO_INCREMENT = 1000
If you have already created the table, you can use ALTER TABLE
to specify the value:
ALTER TABLE tbl_name AUTO_INCREMENT = 1000
The default value that shows up when you use DESCRIBE or SHOW COLUMNS
is unrelated to the actual value that next will be generated.
>
>On Fri, 4 Feb 2000, Paul DuBois wrote:
>
>> At 7:58 PM -0600 2000-02-04, Josh Abrams wrote:
>> >I'm running tests on a field using the auto-increment feature. Does the
>> >auto-increment always start at 0? I attempted to specify another number,
>> >but it still defaulted to 0.
>>
>> ???
>>
>> AUTO_INCREMENT values *never* start at zero. When you insert NULL
>> or 0 into an AUTO_INCREMENT column, the next number in the series
> > is generated. The series begins at one.
--
Paul DuBois, paul@stripped