> I'm using InnoDB tables. I've set one of my fields to auto increment.
> This field has a relationship with another table. I need to
> reset auto increment back to 1 after it reaches the max value (And it
will).
A you sure about that last? If you use BIGINT (63 bits), at 1000 inserts
per second
This actually is more tricky than it sounds.
Firstly the table already exists. So create table is
an option only if you were going to recreate a new
table with an auto_increment column, then move the
rest of the data (except for the index column) in to
the new table, drop the old table and re-n
: Am Donnerstag, 30. Januar 2003 20:15 schrieb Mike Doanh Tran:
: > Hi all,
: >
: > I am creating a new table with an auto_increment primary key.
: > How do i tell mysql to start incrementing at a certain
: value, let say
: > 1000 instead of 1?
: >
: > Thanks,
Am Donnerstag, 30. Januar 2003 20:15 schrieb Mike Doanh Tran:
> Hi all,
>
> I am creating a new table with an auto_increment primary key.
> How do i tell mysql to start incrementing at a certain value, let say
> 1000 instead of 1?
>
> Thanks,
>
> MT
SET INSERT_ID=1000 does it.
Have a look at
http
At a guess, I'd set the default value to 1000 so the first record you insert
has 1000 as it's value, then it will continue on from there.
- Original Message -
From: "Mike Doanh Tran" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 31, 2003 5:15 AM
Subject: setting auto
>From postings at:
http://www.mysql.com/doc/en/example-AUTO_INCREMENT.html
ALTER TABLE tbl_name AUTO_INCREMENT = 1000
will start your records at 1000
Bhavin.
- Original Message -
From: "Mike Doanh Tran" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 30, 2003 2:15 PM
S
RD,
> How can I set auto-increment in mysql to start counting at say 5
rather
> than 1
The manual is your friend.
Enter auto_increment into the search facility. Read 6.5.3 CREATE TABLE
Syntax - which illustrates the answer, or move on to the better description
in the next 'hit' 6.5.4 ALTER
Arul,
Saturday, June 01, 2002, 8:34:40 AM, you wrote:
A> Is it that i can make a column auto increment only if its data type is
A> integer.
A> Can i not set auto increment value for a numeric datatype
You can set up AUTO_INCREMENT attribute for all int's and float's types.
A> -Arul
--
F