Avatar of mikha
mikha
Flag for United States of America asked on

sql workbench

I'm working with sql workbench and still figuring things out.

How to set up a , created and updated column , with datetime value and have created date automatically set , when row is created and update the updated column everytime the row updates.

also , how to set up a default value for a column

I am trying to do this using GUI of sql workbench .
SQL

Avatar of undefined
Last Comment
Kevin Cross

8/22/2022 - Mon
Nick Upson

so workbench is the tool you are using to access what database (which makes all the difference), e.g.postfix. oracle. firebird, sqllite, .....
mikha

ASKER
MySQL version 5.7
Kevin Cross

Are you referring to SQL Workbench/J or MySQL Workbench or other tool?

Note: you can do this from SQL syntax typically to set the initial default then you can use a Trigger on updates to update the column if your application doesn't send this automatically.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
Kevin Cross

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question