Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Foreign key on two fields
Message
De
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:
01520726
Vues:
37
>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 ?
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform