Deleting a SQL row ignoring all foreign keys and constraints

You can set the constraints on that table / column to not check temporarily, then re-enable the constraints. General form would be:

ALTER TABLE TableName NOCHECK CONSTRAINT ConstraintName

Then re-enable all constraints with

ALTER TABLE TableName CHECK CONSTRAINT ConstraintName

I assume that this would be temporary though? You obviously wouldn’t want to do this consistently.

Leave a Comment