Click here to Skip to main content
15,922,584 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Posted
Updated 24-Mar-10 12:25pm
v3

1 solution

If level is the parent table, and every course has one Parent row,
then the child row should point to ALL the columns that are primary key in the parent table, otherwise it won't work.

It looks like a circular reference but, i'm not sure, what exactly your'e trying to do.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900