Reputation: 1
CREATE TABLE comments (
content VARCHAR(100),
created_at TIMESTAMP DEFAULT NOW()
);
The error message
'NOW' is not a recognized built-in function name.
Upvotes: 0
Views: 840
Reputation: 416149
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).
Upvotes: 0