select 99.foo converts to select 99. as foo (since you can leave a space in front of the alias) by selecting "99". like a numeric . Since there are no numbers after the decimal point, it simply displays "99".
You can confirm this by doing:
select sql_variant_property(99., 'BaseType')
which returns numeric .
This is not the same as select 99 as foo , which selects '99', but as an int . This can be confirmed with runnning:
select sql_variant_property(99, 'BaseType')
which returns an int .
Although all three queries seem the same, the first is different from the next two in the return type.
source share