【发布时间】:2011-04-13 07:20:46
【问题描述】:
我在 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;
我该如何解决?
【问题讨论】:
标签: sql visual-studio-2010 sql-server-2008 asp.net-mvc-3