I am trying to set my columns default date time to system datetime. It shows me an error
Invalid default value for 'InsertionDate'
alter table `vts`.`tblpickpoint`
add column `InsertionDate`
datetime DEFAULT 'Now()' NULL after `PickPointLatLong`
The default value for a column in mysql cannot be the result of a function.
The one exception is the current_timestamp as astander points out.
Your statement should be
alter table `vts`.`tblpickpoint`
add column `InsertionDate` TIMESTAMP
DEFAULT CURRENT_TIMESTAMP
Have a look at CURRENT_TIMESTAMP
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With