错误SQL04111:Visual Studio 2010数据库项目

问题描述

| 我在Visual Studio 2010数据库项目的表中创建了一个关系,但出现此错误:
Error SQL04111: The referenced table \'[dbo].[tblAccount]\' contains no primary or candidate keys that match the referencing column list in the foreign key. If the referenced column is a computed column,it should be persisted.
这是外键:
ALTER TABLE [dbo].[tblDispute]
    ADD CONSTRAINT [FK_AccountNo] 
    FOREIGN KEY (AccountNo)
    REFERENCES tblAccount ([Account No])  ON DELETE NO ACTION ON UPDATE CASCADE;
我该如何解决?     

解决方法

好的,我通过添加帐户表中的另一列来解决此问题。帐户表具有两列主键/复合键,在争议表中,我仅添加了两个表之一。     

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...