Constraint GX_GPMX_BAK2008_PK Primary Key(Yyyymm,Gpdno,Gx_no), <--这里少了个逗号
Constraint GX_GPMX_BAK2008_FK Foreign Key(Yyyymm,Gpdno) References Zadb.dbo.GX_GPHZ_BAK2008(Yyyymm,Gpdno)

解决方案 »

  1.   

    Create Table GX_GPMX_BAK2008 

    Yyyymm Char(6) Not Null, 
    GpdNo Numeric(7) Not Null, 
    TxmNo Char(20) Default '', 
    Gx_no Char(2) Not Null 
    Constraint GX_GPMX_BAK2008_PK Primary Key(Yyyymm,Gpdno,Gx_no) 
    --Constraint GX_GPMX_BAK2008_FK Foreign Key(Yyyymm,GpdNo) References GX_GPHZ_BAK2008(Yyyymm,GpdNo) 
    )
    alter table GX_GPMX_BAK2008 add foreign key(Yyyymm,GpdNo) References GX_GPHZ_BAK2008(Yyyymm,GpdNo)
    Constraint 关键字被两次重复使用了,像楼主这种情况,主键外键要分开创建