Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Foreign key on two fields
Message
 
 
To
11/08/2011 12:57:48
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01520713
Message ID:
01520733
Views:
29
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform