create key more than 1024 bytes
Posted by: Chagh
Date: September 06, 2005 04:32AM

hi all,
I am migrating my DB from SQLServer to MySQL. There is an all-key table in SQL Server which i can not move it to MySQL 'cause its index is larger that 1024 bytes. I did not design SQLServer DB so i do not know why is it all-key. what should i do now in MySQL? how can i resolve this problem?

This is my table definition:
CREATE TABLE `relatedfields` (
`GrpCode` int(11) default NULL,
`FieldName` varchar(200) default NULL,
`RelGrpCode` int(11) default NULL,
`RelFieldName` varchar(200) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

and i want to alter this table:
ALTER TABLE `relatedfields` MODIFY COLUMN `GrpCode` INTEGER NOT NULL,
MODIFY COLUMN `FieldName` VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
MODIFY COLUMN `RelGrpCode` INTEGER NOT NULL,
MODIFY COLUMN `RelFieldName` VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
ADD PRIMARY KEY(`GrpCode`, `FieldName`, `RelGrpCode`, `RelFieldName`);

and the error is:
specified key is too long; max key length is 1024 bytes.

Thanks in advance
Chagh

Options: ReplyQuote


Subject
Written By
Posted
create key more than 1024 bytes
September 06, 2005 04:32AM
September 17, 2005 06:08AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.