Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL Server
Expertise: Beginner
Jul 16, 1999

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.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date