Medium severitydata integrity
Power BI Refresh Error:
547
What does this error mean?
An INSERT, UPDATE, or DELETE was blocked by a FOREIGN KEY constraint — the referenced key does not exist in the parent table (or a child row exists in a dependent table).
Common causes
- 1Loading a child table before the parent table in an ADF pipeline
- 2Deleting rows from a parent table that have referencing child rows
- 3Source data references a foreign key value that was not loaded or was deleted
How to fix it
- 1Step 1: Identify the constraint from the error message. Find the parent and child tables: SELECT fk.name, OBJECT_NAME(fk.parent_object_id) as child, OBJECT_NAME(fk.referenced_object_id) as parent FROM sys.foreign_keys fk WHERE fk.name = 'FK_name';
- 2Step 2: Load parent tables before child tables in the pipeline. In ADF, use dependency between activities to enforce load order.
- 3Step 3: For bulk loads where FK validation can be deferred, temporarily disable the constraint: ALTER TABLE [child] NOCHECK CONSTRAINT [FK_name]; — then re-enable and validate: ALTER TABLE [child] WITH CHECK CHECK CONSTRAINT [FK_name];
Frequently asked questions
Official documentation: https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-547-database-engine-error