SQL SERVER – Difference Between GETDATE and SYSDATETIME

Sometime something so simple skips our mind. I never knew the difference between GETDATE and SYSDATETIME. I just ran simple query as following and realized the difference.

SELECT GETDATE() fn_GetDate, SYSDATETIME() fn_SysDateTime

In case of GETDATE the precision is till miliseconds and in case of SYSDATETIME the precision is till nanoseconds.

SQL SERVER - Difference Between GETDATE and SYSDATETIME getdate_sysdatetime

Now the questions is to you – did you know this? Be honest and please share your views. I already accepted that I did not know this in very first line.

This applies to SQL Server 2008 only.

Reference: Pinal Dave (http://www.SQLAuthority.com),

SQL DateTime, SQL Scripts
Previous Post
SQL SERVER – Merge Operations – Insert, Update, Delete in Single Execution
Next Post
SQL SERVER – Difference Between DATETIME and DATETIME2

Related Posts

Leave a Reply