Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conditional cascade delete
Message
De
26/07/2001 12:05:36
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, États-Unis
 
 
À
21/07/2001 09:48:53
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00532818
Message ID:
00535819
Vues:
10
Thanks for the suggestions. I experimented with an INSTEAD OF delete trigger that does what I want. Seems to work fine. I'm still hazy about the real differences between a regular delete trigger and an INSTEAD OF delete trigger however, but since it's working, I'll probably just back away slowly with no sudden movements and let it continue on.

Gary


>>Hi all,
>>I'm trying to handle a cascading delete based on values in the child table. In other words, I want the delete to cascade if a user hasn't entered a value in a certain field of the child else disallow the delete of the parent record. Any suggestions on the best way to accomplish this? I tried to set up a delete restrict if a child record exists and then put code in the parent checking the child condition and deleting the child records if it's OK. Didn't work, I assume the trigger fires too late. Thanks.
>>
>>Gary Foster
>
>Gary,
>
>It sounds like you should create a delete tigger on the parent which checks the see if the delete of the parent should be allowed, if not, rollback the transaction, if it is allowed continue and the children should be deleted.
>
>BOb
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform