What is Difference between GETDATE and SYSDATETIME in SQL Server 2008?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pradip PandeyRank #452 · 5.6K reputationPosted Jul 31, 2012, 7:24 PM EDT
Both the function returns almost same result but one difference between these two and i.e. milliseconds & nanoseconds. When you use GETDATE() the precision is till milliseconds but in case of SYSDATETIME() it is nanoseconds.
Jignesh TrivediRank #16 · 50.3K reputationPosted Jul 31, 2012, 8:05 PM EDT
Hi,
The function GETDATE() returns the seconds part of the time in three fractions. The function SYSDATETIME() however returns the seconds part of the time in seven fractions.
The data type DATETIME2 stores dates and times in a higher precious than the (old) data type DATETIME and therefore the difference between GETDATE() and SYSDATETIME() is important when using DATETIME2.
Please refer
http://blog.sqlauthority.com/2010/06/10/sql-server-difference-between-getdate-and-sysdatetime/
hope this will help you.