Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update date to a current date in the event of value chan
Message
De
16/06/2010 10:00:01
 
 
À
16/06/2010 09:53:57
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
01469101
Message ID:
01469215
Vues:
34
I was hoping no one will ask.

But since you did.
I thought I cannot update a table inside the trigger for which trigger is created.
When Sergey said this is the only place... well lets say I felt dumb.

:)


> I have "nStndCost" field, that holds a Standard Cost of the product, and dStndCost (smalldatetime) field in my "Inventory" table.I want to make sure that if the value of the "nStndCost" field is changed by anyone, the dStndCost field (smalldatetime) will change its value to the current date time.
>I cannot update field values it in the AFTER UPDATE trigger on the "Inventory" table. Where can I trigger the change?

>
>
>Hi, Yelena,
>
>As Sergey pointed out, the AFTER UPDATE is where you want to do that.
>
>I'm just curious - what's the reason you can't update field values in the AFTER UPDATE? Updating a date column based on some other column value change (for the row) is pretty basic stuff - so I wanted to ask why.
>
>Thanks...
>Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform