Answer the question
In order to leave comments, you need to log in
How to fix FOREIGN KEY error?
There are two tables /Users/egortimonin/Desktop/Screenshot 2020-07-19 at 15.48.25.png in tblMessage all IDs are unique, but EQUIPMENT_ID can be repeated, when filling the tblMessage table SQL complains and writes
Конфликт инструкции INSERT с ограничением FOREIGN KEY "FK__tblMessag__EQUIP__0559BDD1".
Конфликт произошел в базе данных "dbo", таблица "dbo.tblEquipment", column 'ID'.
I don't understand why this is happening, I have a one-to-many relationship where one tblEquipment entry can have many entries in the tblMessage table. Why is there an error?
Answer the question
In order to leave comments, you need to log in
You are adding to a tblMessage
string with a value EQUIPMENT_ID
that is not in tblEquipment
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question