SQL Server engine errors

Conflicted Constraint

547
MediumDatabase Engine

Reviewed for reference consistency: August 11, 2026

the statement conflicted with a foreign key or check constraint

What 547 Means

The 547 error on the SQL Server engine errors indicates conflicted constraint — the statement conflicted with a foreign key or check constraint. This typically occurs due to attempting to delete a record that is still referenced by other tables.

Error 547 means the statement conflicted with a FOREIGN KEY or CHECK constraint and was cancelled to keep related tables consistent. The check runs at the end of statement execution: any row that would orphan a reference or violate a CHECK rule cancels the whole operation. The message names the constraint, which identifies the relationship or rule involved.

Technical Background

The 547 error is the primary mechanism for enforcing Referential Integrity in SQL Server. By preventing actions that would leave 'orphaned' records or invalid references, the database ensures that relationships between entities (like Customers and Orders) remain consistent.

This error is triggered at the end of a statement execution. If any row modified or deleted by the statement violates a constraint, the entire operation is cancelled and no changes are committed to the database.

Common Causes

  • Attempting to delete a record that is still referenced by other tables
  • Inserting a foreign key value that does not exist in the parent table
  • Updating a column with a value that violates a CHECK constraint

Typical Scenarios

  • Deleting a customer who still has active orders in the system
  • Assigning a task to a non-existent employee ID

What to Know

Reviewing the specific constraint name provided in the error message allows for targeted data cleanup. Handling dependent records or ensuring compliance with CHECK constraint criteria resolves the underlying violation.

Frequently Asked Questions

Common questions about SQL Server 547 error

Yes, SQL Server rolls back the statement that caused the violation to maintain data integrity.

Related Errors From Other Categories

Similar error codes documented across different platforms and systems