问题描述
我创建了这三个表,其中一个是
部门(dep_no int PK,dep_name nvarchar),-LEVEL的父表
第二个表是LEVEL(lvl_dep_key int PK,dep_no int FK& PK,lvl_id nvarchar Pk)-课程的父表&部门的子表
我将lvl_dep_key用作lvl_id和dep_no列的超级键
将其与子表相关联,而不是将lvl_id和dep_no列都与这些表相关联
第三张表是课程(lvl_dep_key int FK& PK,cors_id nvarchar PK,cors_name nvarchar,price money)-LEVEL的子表
因此,当我尝试通过这些列(LEVEL表的lvl_dep_key和Courses表的lvl_dep_key)在LEVEL表和课程表之间建立关系时,收到此错误消息"表[LEVEL]中的列与现有的主键或UNIQUE约束",我用Google搜索了一下是什么意思,但没有任何好处.所以有什么可以帮助我解决这个问题plzzzzzzzzzz.谢谢
Hi, i create these three tables one is
department(dep_no int PK , dep_name nvarchar ), -- parent table of LEVEL
second table is LEVEL(lvl_dep_key int PK , dep_no int FK & PK , lvl _id nvarchar Pk) -- parent table of courses & the child table of department
i make the lvl_dep_key as a super key for both lvl_id and dep_no columns
to relate it to the children tables instead of taken both lvl_id and dep_no columns to these tables
third table is courses( lvl_dep_key int FK & PK , cors_id nvarchar PK, cors_name nvarchar,price money) -- the child table of LEVEL
so when i tried to create the relationship between LEVEL table and courses table by these columns which is (lvl_dep_key of LEVEL table , and lvl_dep_key of courses table i get this error message " the columns in table [LEVEL] do not match an existing primary key or UNIQUE constraint ", i googled to know what it''s mean but no benefit . so can any help me to solve this problem plzzzzzzzzzz. thanks
推荐答案
这篇关于该错误消息是什么意思,如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!