Grant Griffith wrote:
I am trying to add an autoincrement field to a table that already exists
and I keep receiving errors when trying to do it. Can someone point me
in the right direction on how I can do this? I have access via Webadmin
and phpMyAdmin, so I can try it however I need to.
ALTER TABLE [table] ADD [fieldname] [integer type] not null
auto_increment key;
or if you want it to be the primary key:
ALTER TABLE [table] ADD [fieldname] [integer type] not null
auto_increment primary key;
Keep in mind that you can have only one auto_increment column and it
must be part of a key.
regards
Nils
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]