Why would SQL Server silently fail to re-enable a foreign key constraint?
I recently attempted to re-enable a number of constraints using
ALTER TABLE. Most enabled successfully; however, minority of the constrains are still reported as disabled by
ALTER TABLE [dbo].[Table] WITH CHECK NOCHECK CONSTRAINT FK_ConstraintName; -- Command(s) completed successfully. SELECT is_disabled FROM sys.foreign_keys WHERE name = 'FK_Constraint' AND parent_object_id = OBJECT_ID('[dbo].[Table]'); -- returns "1", indicating that the constraint is still disabled