--Msg 3726, Level 16, State 1, Line 11
--Could not drop object 'xxxxx' because it is referenced by a FOREIGN KEY constraint.

EXEC sp_fkeys 'xxxxx'


IF (OBJECT_ID('[FK_xxxxx]', 'F') IS NOT NULL)
BEGIN
    ALTER TABLE dbo.xxxxx DROP CONSTRAINT [FK_xxxxx]
END
Last modified: May 4, 2022

Author

Comments

Write a Reply or Comment