Set Cascade DELETE/UPDATE in SQL ServerPosted: April 29, 2013
Try to set up cascading delete/update in your database through SSMS. Here is the steps:
You can set the Delete/Update Rule to Cascade for the foreign key. In SQL Server Management Studio, Click on your table name and find the Keys and expand i;, right click on the foreignkey name in your key collection and click Modify>> under INSERT and UPDATE specification to see the Delete Rule and Update Rule. The default value is No Action for DELETE Rule or UPDATE Rule. You need to change the value to Cascade.
You can use T-SQL script to set these:
ALTER TABLE [dbo].[ChildTable] WITH CHECK ADD CONSTRAINT [FK_ChildTable_ParentTable] FOREIGN KEY([aid]) REFERENCES [dbo].[ParentTable] ([AId]) ON UPDATE CASCADE ON DELETE CASCADE GO