High severitydata integrity
Power BI Refresh Error:
1216
What does this error mean?
An INSERT or UPDATE on a child table references a parent key value that does not exist.
Common causes
- 1Data is loaded into child tables before the referenced parent rows exist
- 2ADF pipeline load order does not respect foreign key dependencies
- 3dbt model execution order does not account for FK relationships
- 4Source data contains orphaned child records with no matching parent
How to fix it
- 1Step 1: Identify which FK constraint failed from the error message.
- 2Step 2: Ensure parent table rows are inserted before child rows — reorder ADF activities using dependencies.
- 3Step 3: Temporarily disable FK checks during bulk load if load order cannot be changed: `SET FOREIGN_KEY_CHECKS=0;` then re-enable after: `SET FOREIGN_KEY_CHECKS=1;`
- 4Step 4: Clean orphaned source records: `DELETE FROM child WHERE parent_id NOT IN (SELECT id FROM parent);`
Frequently asked questions
Official documentation: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html