What is the data type of "select 123.866" in SQL server 2005? -


If I just write something

  choose 10.00;  

How does it bring me?

Here is a test that I went to, to test the binary representation of these types. The surprising thing here is that does not really match the first line in any armor! Select cast (as 123.866 binary) Union All selected artists (cast (123.866 real) as binary) All selected artists (float as cast (123.866) Association as binary) All selected artists (as binary in the form of Cast (123.866 decimals) Union All selected artists (cast (numerical as 123.866) binary as union) All selected artists (cast (123.866 Form of money) form of binary In) union branch select all (cast (as 123.866 smallmoney) in binary form) -------------- 0x0000000000000000000000000000000000000000000006030001DAE30100 0x000000000000000000000000000000000000000000000000000042F7BB64 0x00000000000000000000000000000000000000000000405EF76C8B439581 0x00000000000000000000000000000000000000000000120000017C000000 0x00000000000000000000000000000000000000000000120000017C000000 0x00000000000000000000000000000000000000000000000000000012E684 0x00000000000000000000000000000000000000000000000000000012E684

Can anyone explain this?


Basically, to avoid writing all the cast studios I wanted to do, assuming 123.866 meant a decimals. So I thought to test whether these two statements were the same:

  Choose cast (123.866 as decimal) 123.866 Select  
< P>

It is basically typed as decimal (6,3) - cast it over and you get binary values. It seems that to use the decimal number after decimal after decimal, in the smallest tape to fit the value - in this case, 6 digits.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -