Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete in child table should update parent modidate
Message
 
 
À
03/03/2003 10:47:30
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Divers
Thread ID:
00760229
Message ID:
00760383
Vues:
12
Hi Bob,

I want to be able to type command delete from CartContent where CartContentID in (1,2,3,4) and it should automatically delete all child records in CartDetail and update info in Cart. If I set cascading deletions, does it mean, that in my trigger I have to program only Update part?



>If you are doing the delete with a SP, you can add the update to it's transaction. If you are using Client side SQL then you can use a delete trigger.
>
>BOb
>
>
>>Hi everybody,
>>
>>I have 3 tables:
>>     Cart
>>        |
>>         CartContent
>>             |
>>              CartDetail
>>
>>When I delete a record in CartContent, I want to delete all children in CartDetail (that's done from cascading deletes) and also update Cart.ModiType with 'D' and Cart.Modidate with getdate(). What should I do to accomplish that?
>>
>>Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform