I have parent table let say CAR, and its multiple props/records in child table let say CAR_PROPS.

Now CAR has modified_date column like


Since CAR along with its all properties are treated as single object, we are expecting any change on its props (CAR_PROPS) alone should also update the parent table (CAR's) modified_date.

However this is not real since CAR doest really updated hence modified_date is not changed when any of its child record got updated.

To simplify i want sql column modified_date to be updated, though i dont have anything/anyother column to update in the row.

How to solve this problem?

NOTE: I dont want to pass the modified_date from server, just want go with DB timestamp.


Provided you have no control how the CAR_PROPS gets updated (i.e. you didn't write a suitable stored procedure to do what you need to do) then I can only think of implementing a trigger on the CAR_PROPS table so that it goes off and updates the dateModified for the car whose props were edited.

if you do have control, and you can tell me people to update things in a particular way and you can write and use a stored procedure for this then that's what I would do.

I hope this makes sense,


| improve this answer | |

Create a trigger that updates CAR.modified_date with the current timestamp from the database.

Whilst "ON UPDATE CURRENT_TIMESTAMP" will provide a value for you if you don't supply one, there is nothing to stop you setting the field directly for yourself.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.