The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Schedule_Counsellor_CounsellorId"

Viewed 63

The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Schedule_Counsellor_CounsellorId". The conflict occurred in database "aspnet-RapeCrisisCounsellorSystem-53bc9b9d-9d6a-45d4-8429-2a2761773502", table "dbo.Counsellor", column 'CounsellorId'.

enter image description here

enter image description here

I am not sure what the problem is, is there anyone who can help me in identifying the issue

1 Answers

You are trying to insert a value into a column, that column is an fk to the pk of another table and there is no record in that second table where the pk value matches the fk value

Related