Why does the millisecond portion of a MS SQL Server DateTime
data type always end in 0, 3 or 7? I've hit F5 on a SELECT GetDate()
numerous times, and the milliseconds consistently end in one of those three numbers.
To demonstrate, I've made this example, with the results below:
DECLARE @t TABLE (dt DateTime)
DECLARE @i INT = 1
WHILE @i <= 2000
BEGIN
INSERT INTO @t(dt) VALUES(GetDate())
SET @i = @i + 1
END
SELECT DISTINCT dt FROM @t
2016-08-05 15:38:06.380 2016-08-05 15:38:06.383 2016-08-05 15:38:06.420 2016-08-05 15:38:06.630 2016-08-05 15:38:06.817 2016-08-05 15:38:07.053 2016-08-05 15:38:07.057 2016-08-05 15:38:07.230 2016-08-05 15:38:07.233 2016-08-05 15:38:07.453 2016-08-05 15:38:07.457 2016-08-05 15:38:07.510 2016-08-05 15:38:07.570 2016-08-05 15:38:07.623 2016-08-05 15:38:07.690 2016-08-05 15:38:07.693 2016-08-05 15:38:07.747 2016-08-05 15:38:07.750 2016-08-05 15:38:07.800 2016-08-05 15:38:07.803 2016-08-05 15:38:07.857 2016-08-05 15:38:07.910 2016-08-05 15:38:07.913 2016-08-05 15:38:07.967 2016-08-05 15:38:07.970 2016-08-05 15:38:08.027 2016-08-05 15:38:08.080 2016-08-05 15:38:08.130