Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Triggers, stored procedures
Message
From
11/08/1999 19:41:15
Cheryl Qualset
Qualset Computer Consulting
Davis, California, United States
 
 
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
00244883
Message ID:
00252792
Views:
12
>>>> I don't know how to cascade parent key changes to children when it is more than 1 parent record being changed.
>>>
>>>
>>>That's a good problem. There's nothing to link the Inserted and Deleted tables if you've changed the primary key. Is there a candidate key that can be used to relate the children?
>>>
>>
>>That's where I am. I wanted a generic or at least template solution.
>>I started all this by trying to make the databases as similar as possible. At this point it is merely an exercise. The data behavior is similar enough so my app is happy.
>>
>
>Would it be possible to limit parent primary key changes to one parent at a time?
>
>-Mike

This would require application or middle-tier logic, which is certainly possible. I was trying to make the database self-healing, so to speak. The best I came up with was to have the trigger deny updates of more than 1 at a time when the key field is involved. Enforcing it that allows the trigger to make the correlation between inserted and deleted ...
Previous
Reply
Map
View

Click here to load this message in the networking platform