• Jeff Moden (8/2/2014)


    Eirikur Eiriksson (8/2/2014)


    The datetime format is still the same upto and including 2014.

    😎

    Thanks Eirikur. I've never looked at it but figured it might be so. That does, however, make my disappointment in the DATETIME2 data type even deeper. Except for the precision byte, it's virtually identical to DATETIME... why would they cripple the data type by making direct addition and subtraction impossible?

    What adds to the disappointment is that the DATETIME2 data type, even when scaled back to DATETIME2(3) to produce the same number of digits (but, not the same accuracy) as DATETIME is 49% slower than when the same code is used for DATETIME. Yeah, it takes millions of rows for that to really add up but I have millions of rows that I work with.

    The DATETIME2 solution that requires DATEPART is also 72% slower than DATETIME with the decimal conversion.

    I agree, as anything that sounds too good to be true, datetime2 isn't. Although it saves 3 bytes and it's ansi/ iso compliant, honestly, no improvement over smalldatetime though, same number of bytes and realistically, unless one is doing far fetched statistics, the range of smalldatetime is more than enough.

    😎