I was reviewing some SQL queries and I saw a select statement that looked like this
SELECT * FROM dbo.mytable WHERE (dbo.mytable.[Date] < { fn NOW() })
What is the purpose of using a WHERE statement like this?
Wouldn’t be easier to use a simple GETDATE()?
http://www.sqlservercentral.com/Forums/Topic183904-8-1.aspx
GETDATE() is a T-SQL specific function which returns the current system date and time. The SQL standard equivalent is CURRENT_TIMESTAMP which is applicable in T-SQL as well. The {fn Now()} is an ODBC canonical function which can be used in T-SQL since the OLE DB provider for SQL Server supports them. There are no notable performance difference between these though. You can also use canonical format like :