Jeff Moden wrote:
Correct... but it didn't convert to FLOAT in other versions either (thank goodness for that!)... It converts numeric literals (constants) that have a value larger than the bounds of INT to the NUMERIC() datatype with a "0" for scale. At least it's NUMERIC() and not FLOAT... that would cause some serious inaccuracies due to the limited scale of FLOAT().
I can see it using NUMERIC() if it exceeds the bounds of BIGINT but it shouldn't be implicit, IMHO. That should be one place where an explicit cast of a numeric constant should actually require an explicit conversion.
And it'd better be converted to FLOAT straight away.
For the sake of precision.
Check this out:
select SQL_VARIANT_PROPERTY(2147483648, 'basetype') basetype,
SQL_VARIANT_PROPERTY(2147483648, 'precision') [precision],
SQL_VARIANT_PROPERTY(2147483648, 'scale') scale
It's NUMERIC(10,0) - precision is actually lower than for FLOAT, which is
16 53 .
But now let's try this:
select SQL_VARIANT_PROPERTY(2147483648/1000, 'basetype') basetype,
SQL_VARIANT_PROPERTY(2147483648/1000, 'precision') [precision],
SQL_VARIANT_PROPERTY(2147483648/1000, 'scale') scale
Now it's NUMERIC(16,6)
Can you guess where precision=16 is coming from?