Sample Header Ad - 728x90

datetime2(0) vs datetime2(2)

22 votes
1 answer
25951 views
According to the documentation datetime2 (Transact-SQL) : > **Storage size** >6 bytes for precisions less than 3. 7 bytes for precisions 3 and 4. All other precisions require 8 bytes. The size of datetime2(0), datetime2(1), datetime2(2) use the same amount of storage (6 bytes). Would I be correct in saying that I might as well go with datetime2(2) and gain the benefit of the precision without any additional size costs? Please note: - This column is indexed with the PK to form a compound clustered index (used for table partitioning) - I do not care about milliseconds Would datetime2(0) be more cpu efficient when used in a where clause, or when seeking through an index? This is a massive table, so the smallest optimization will make a big difference.
Asked by Zapnologica (779 rep)
Jan 11, 2017, 11:36 AM
Last activity: Sep 26, 2019, 03:46 PM