Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Foreign key on two fields
Message
 
 
À
11/08/2011 12:57:48
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01520713
Message ID:
01520733
Vues:
28
>>Gregory,
>>
>>In my case the child table does have these fields (I don't know you remember an example I described in another thread). For example, the parent table (Accounts) will have fields COST_CENT (char) and SITE_NO (int)). And the child table (Purchase orders) will have the same two fields COST_CENT (char) and SITE_NO (int). If user will change the value in the COST_CENT of the parent table, all POs where this value is set should be changed. Hence the need for the constraint with cascading update.
>>
>>
>
>if Accounts has (amongst other fields)
>
>Accounts_pk
>Accounts_cost_cent
>Accounts_Site_no
>
>Then, the PO table should only have an Accounts_fk, since Site_no and cost_cent can be retrieved with an sql join
>
>If you do not store the cost center and the site_no in the PO, then you do not need a cascading update - do you ?

I see what you are saying. But this would be the case if I designed the application right in the first place <g>.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform