The INSERT statement conflicted with the FOREIGN KEY constraint "XXX". The conflict occurred in database "XXX", table "XXX", column "XXX" error and how to fix it
It is very common to do migrations of data from a table of one database to another or inserting backed-up data into a table. For these tasks you will have to use long .sql scripts with INSERT statements.
When doing such migrations one possible problem might be that the Foreign Keys referenced in the primary-table will throw the INSERT statement conflicted with the FOREIGN KEY constraint “XXX. The conflict occurred in database “”, table “”, column “” error.
Read the complete article