Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

dependencies between tables

Posted on 2003-03-07
4
Medium Priority
?
196 Views
Last Modified: 2008-03-10
How can i make a depedencie between fields of different tables , so that when i delete a record in one tabel it can't be deleted when there's a record in the other table that depends on the one thats getting deleted ?
0
Comment
Question by:stanja
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 200 total points
ID: 8088392
Create a foreign key. For that, the field in the "main" table needs to be primary key.

Another option is to use a trigger, which checks the dependency, and can roll back the transaction. The foreign key thing is easier to implement, but might not be possible in all the cases due to the limitations imposed of the constraint.

Cheers
0
 

Expert Comment

by:CleanupPing
ID: 9276070
stanja:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 12

Expert Comment

by:monosodiumg
ID: 11042378
No comment has been added to this question in more than 251 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Accept: angelIII http:#8088392

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

monosodiumg
EE Cleanup Volunteer
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question