Quantcast
Channel: MySQL Forums - MySQL Workbench
Viewing all articles
Browse latest Browse all 3724

Table datetime updates (no replies)

$
0
0
Using work bench I have a table with columns for date_created and Date_updated the data type is DATETIME

I want the date_created to be set to current_time_stamp when the record is created (insert) and to never change

For date_updated I want it to be set to the current_time_stamp when it is inserted/created and set to the current_time_stamp when ever the recorded is updated

Using the column name for date_created I set the default = current_timestamp
Will this work

for date_updated I left the default blank, do I need to create a triger?

Can some one give me an example of ho to set this up

Thanks

Viewing all articles
Browse latest Browse all 3724

Trending Articles