Somebody will correct me if I am wrong, but I think cannot have a column in
a table that has the same name as a MySQL reserved word.

You are going to have to change it. 'Key' is simply NOT going to work for
your column name.

On the reasonable chance that I am wrong, the documentation that I am
looking at for ALTER TABLE xxx CHANGE ... Looks like this:

ALTER TABLE table CHANGE [column] new_column_name create_clause


So, in your query, try

ALTER TABLE tblSuppliers MODIFY Key CHAR(6) NOT NULL;


Because if the syntax error is because it is trying to create a new column
that shares an existing column name (even if temporarily) this could fix
that.

On 3/28/01 1:19 AM, "Richard Harris" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I am importing an Access 97 Database into MySQL.
> One of tables tblSuppliers holds all the critical supplier information and has
> a 4 character Primary key called 'Key'
> This is heavily used throughout a lot of VB code in the Access GUI and can't
> really be changed easily.
> 
> When I import the Access tables into MYSQL, they lose their indexes and
> primary keys.
> 
> Try as I might, I can't change the properties of the Key column using Alter
> Table, it keeps coming back with syntax errors.
> I'm currently stuck on the following,
> 
> ALTER TABLE tblSuppliers CHANGE Key Key CHAR(6) NOT NULL
> 
> What am I doing wrong/ is there a work round?
> 
> Thanks in advance for you help.
> 
> 
> Richard Harris
> 


---------------------------------------------------------------------
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