在被引用表中没有与外键的引用列的列表匹配的主键或候选键的问题。请批教。谢谢!!
俩个表结构是这样
create table TABCLASS
(
CLASSID CHAR(4) not null,
STATE int not null,)
alter table TABCLASS
add constraint PK_CLASSID primary key (CLASSID,STATE)
create table TABPRODUCTFORCODE
(
FORCODE CHAR(15) not null,
MCLASSID CHAR(4) not null,
)
alter table TABPRODUCTFORCODE
add constraint PK_FORCODE1 primary key (FORCODE)
可是执行下面的语句出现错误.
alter table TabProductForCode
add constraint FK_TPFC_MclassID foreign key(MclassID)
references TabClass(ClassID)
提示如下:
在被引用表 'TabClass' 中没有与外键 'FK_TPFC_MclassID' 的引用列的列表匹配的主键或候选键。
请是这个要如何解决.是不是要修改TabClass表结构。谢谢!!