CREATE TABLE comments (
content VARCHAR(100),
created_at TIMESTAMP DEFAULT NOW()
);
The error message
'NOW' is not a recognized built-in function name.
CREATE TABLE comments (
content VARCHAR(100),
created_at TIMESTAMP DEFAULT NOW()
);
The error message
'NOW' is not a recognized built-in function name.
NOW()
is not ansi-standard sql.
Given this is a SQL Server error message, I'll say that SQL Server people tend to use getdate()
instead. However, the actual standard is current_timestamp
, which FWIW is supported on both SQL Server and whichever of MySql or Posgresql you were using before, albeit they both treat is as a function (you need parentheses) while SQL Server treats it as a keyword (no parentheses).