Thursday, October 22, 2009

Question of the Day: MS SQL Server: TSQL vs PL/SQL

What is the ANSI SQL equivalent to GETDATE()?

By Philipp Post

Answer: CURRENT_TIMESTAMP

Explanation: The ANSI SQL equivalent to GETDATE() is CURRENT_TIMESTAMP. GETDATE() is proprietary to the SQL Server system. If you would like to ensure to write most standards compatible and portable code, you should use CURRENT_TIMESTAMP.

Ref: CURRENT_TIMESTAMP – http://msdn.microsoft.com/en-us/library/ms188751.aspx

» Discuss this question and answer on the forums

No comments:

Post a Comment