T.C :
Lajos Arpad :
Run
select studentTakingModule.PageID
from studentTakingModule
where not exists (
select 1
from pages
where pages.PageID = studentTakingModule.PageID
);
Presumably (based on the error message you received) the result will be non-empty. The values in the result are PageID
values which do not exist in the pages
table
. If such values exist, you cannot create that foreign key
. You will need to make sure that all the not null
PageID
values in your studentTakingModule
exist as pages.PageID
. Otherwise the reference your record should point to would not exist. This is what the error message is telling you.