Murray Brown
asked on
SQL cRetae table with Date Field that defaults to today's date
Hi
What SQL syntax would I use to create a table in SQL that has a Date Field that defaults to today's date when data is uploaded?
What SQL syntax would I use to create a table in SQL that has a Date Field that defaults to today's date when data is uploaded?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please use always explicitly named constraints. Otherwise you'll have a hard time reading error messages. While this is not really a DEFAULT problem, it especially is created by the short
So, for symmetry or completeness reasons: Also name DEFAULT constraints.
CREATE TABLE tablename
(
id INT PRIMARY KEY
);
So, for symmetry or completeness reasons: Also name DEFAULT constraints.
ASKER
Thanks
ASKER