PDA

Click to See Complete Forum and Search --> : Insert/Update foreign key restraint and cascading delete question (SQL Server)


666539
Aug 18th, 2000, 02:39 PM
I have a master/detail database which has 2 related tables. I want to keep the foreign key restraint "enable relationship for insert and update" and I also want to be able to perform a cascading delete on the master table and have all the records in the detail table deleted.

I have the trigger set up. The cascading delete works but only when the "enable relationship for insert and update" foreign key restraint is enabled.

Is there any way to key this constraint and have a cascading delete? I'm new to triggers so maybe there's a more complex trigger than can be written to handle that.