If v.3.23+, it's a one-step, along the lines of:

ALTER TABLE tablename ADD columnname INT UNSIGNED NOT
NULL PRIMARY KEY AUTO_INCREMENT = 1000

Prior to 3.23, it's a three-step:

1st, alter the table to include the key:

ALTER TABLE tablename ADD columnname INT UNSIGNED NOT
NULL PRIMARY KEY AUTO_INCREMENT

Then, 'trick' the column by--

INSERT INTO tablename (col1, col2, [etc.] columnname)
VALUE ('value1','value2','999')

Then, after inserting your first true record,

DELETE FROM tablename WHERE columnname = '999'

And you're good to go...


--- Armando Cerna <[EMAIL PROTECTED]> wrote:
> How would I add customer id numbers which start at
> 1000 to an already 
> existing table.  I need these numbers to
> auto_increment.  Any help would be 
> great
> 
> Armando
> 
>
---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list
> archive)
> 
> To request this thread, e-mail
> <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
>
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try:
> http://lists.mysql.com/php/unsubscribe.php
> 


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to