What is the difference between GETDATE
and SYSDATETIME
? Which one is commonly used?
Any help is appreciated.
For GETDATE
the precision is till miliseconds and in case of SYSDATETIME
the precision is till nanoseconds.
SELECT GETDATE() fn_GetDate, SYSDATETIME() fn_SysDateTime
yields
fn_GetDate fn_SysDateTime
----------------------- ---------------------------
2018-07-20 11:07:26.403 2018-07-20 11:07:26.3980117
DATETIME
is commonly used as higher precision corresponds to lower efficiency(marginally) in case of SYSDATETIME
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With