Establish Referential Integrity

Question:
How do you Establish Referential Integrity between 2 tables so that when a ticket is deleted from the TICKETS table all associated information in the customer5 table will be deleted?

Answer:
Forgive me if I missed the boat, but it seems that you want to delete the parent records on deletion of a child record. I think this is unusual, in that the problem is usually stated as retaining history in the absence of parents. If this is indeed what you intend, you can find the ticket.customer_id in the deleted table and use it to delete the customer record with that id as its primary key, but I wouldn’t recommend doing that.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: