March 14th, 2013, 01:23 PM
How can I fire up a SP when a field is updated/changed
I have a table with a fields named "unique_id","Status","Status_Updated","Op_Won"
What I am looking for is a stored procedure to update the datetime field "Status_Updated" when the field "Status" gets changed.
Also, if the field "Status" gets changed to "Won" then I would like to populate the field "Op_Won" with the current datetime.
Any ideas...and thanks in advance.
Good afternoon bholmstrom,
I don't know if you solved your problem, but this is my solution : use trigger, and the SQL NOW() function
Add a trigger on your table. You can specify when you want it to go off. In your case, during the Status's modification, so an UpDate query. Trigger will run every time you run an Update query on this table.
In order to put the current date in Status_Updated's column, use SQL Now() which return the current system date and time.
A stored-procedure is not using for this work.