Have you ever wanted to return the time found in GETDATE or CURRENT_TIMESTAMP to a higher level off accuracy in SQL? Well I am going to show you how.
The other day I needed to get the current time to greater accuracy due to the time stamp given to some records and I had to use the following functions which give the time to the millisecond.
SELECT SYSDATETIME () — System time and date
SELECT SYSDATETIMEOFFSET () — The time is included.
SELECT SYSUTCDATETIME () — The date and time is returned as UTC time