tsql script to add delete cascade to existing tables
is there a script that can be used to enable cascaded deletion for existing tables. Thanks. VMAtm ALTER TABLE [wm].[TABLE_NAME] WITH NOCHECK ADD CONSTRAINT [FK_TABLE_NAME_PARENT_TABLE_NAME] FOREIGN KEY([FOREIGN_KEY]) REFERENCES [wm].[PARENT_TABLE_NAME] ([PRIVATE_KEY]) ON DELETE CASCADE GO TABLE_NAME : name of the table where the children are stored. PARENT_TABLE_NAME : name of the table where the parents are stored. This placeholders can be equal FK_TABLE_NAME_PARENT_TABLE_NAME : just name for the constraint FOREIGN_KEY : field in the child table for the connection with the parents, for