Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update date to a current date in the event of value chan
Message
 
 
To
16/06/2010 10:00:01
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
01469101
Message ID:
01469219
Views:
31
I also feel very inadequate after speaking with Sergey <g>. I think he gets a kick back from my therapist <g>

>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
"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
Reply
Map
View

Click here to load this message in the networking platform