| Databases InterBase (29) MS-SQL (5) mysql (37) Oracle (1)
|
Modifying a field to be auto_increment
Question: I need to modify my primary key to be an auto_increment field.Answer: For some reasonTable name: T1, primary key field name: F1 alter table T1 change F1 F1 integer not null auto_increment; will work, but alter table T1 change F1 F1 integer not null auto_increment primary key; does not work. However, after statement #1 the field F1 will still be the primary key. This was observed in mysql 4.0
Comments:
| |||||||||||||||||||