I want to create a table with two column, one “created” and one “modified”, with a timestamp type. I don’t want them to have a default value. But when I create them, it automatically puts CURRENT_TIMESTAMP as default for at least one of them, and also on update.
How can I just have type timestamp with no default or on update value for any of my column?
Edit: I use MySQL
If you are using SQL Server, the
timestamptype is used for row versioning, not for storing an actual date or time value. See MSDN.You could create the columns with a
datetimedatatype and then set yourcreatedandmodifiedvalues with triggers.