Skip to content
Advertisement

Unable to drop constraint in SQL server 2005, “Could not drop constraint. See previous errors”

I’m trying to drop a constraint on a DB table, something like:

ALTER TABLE MyTable drop CONSTRAINT FK_MyTable_AnotherTable

But the execution just runs and runs. If I stop it I see:

Msg 3727, Level 16, State 0, Line 2
Could not drop constraint. See previous errors.

Web search throws up various pages but note that the constraint is properly named and I am trying to remove it using the correct name

Advertisement

Answer

Found a way to sort this, although I don’t understand why it was necessary.

Have been able to drop the constraint by disabling it first:

ALTER MyTable NOCHECK CONSTRAINT FK_MyTable_AnotherTable

The drop then completes fine

Would still welcome any comments on the reason why this is necessary

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement