In SQL Server you can use FLOAT
or REAL
to store floating point values the storage format of which is cleared defined by the IEEE 754 standard. For
Martin's Smith comment gives you the clue. SQL Server does not use BCD.
It stores the data as a whole number, without the decimal place (which it can do because the decimal place is stored in the metadata for the column). So 5.7456
is stored as 57456
, or 0xE070
. After SQL's infamous byte swapping this is transformed to 70 E0 00 00
.
The leading 01
is the sign. 01
is used for positive numbers; 00
for negatives.
(However, I must ask - why do you need this? In typical use, you should never need to bother with SQL Server's internals)