F-J-K
asked on
How to Delete Parent Record if Child Record is Deleted - MS SQL Server
I have two tables:
Customer
Phone
Customer has PhoneID as foreign key which points to PhoneID pk in Phone table.
If a customer record is deleted, i want the associate phone record in phone table to be deleted also. Obviously, i can not use ON DELETE CASCADE because in my case, i'm cascading deletion in reverse manner.
Any idea what to do?
Customer
Phone
Customer has PhoneID as foreign key which points to PhoneID pk in Phone table.
If a customer record is deleted, i want the associate phone record in phone table to be deleted also. Obviously, i can not use ON DELETE CASCADE because in my case, i'm cascading deletion in reverse manner.
Any idea what to do?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
In short, i want to delete a parent record if a child record is deleted. ON DELETE CASCADE only works for the opposite way.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
ASKER