I had created table which hold small floating values using below query
create table temp_data (val float)
But when it gives warning message for very small values (e-314)
insert into temp_pce_rank_data values(2.466987305926227e-314)
Data gets inserted with value '0'
warning message is: The floating point value '2.466987305926227e-314' is out of the range of computer representation (8 bytes).
How I can store & retirve very small values (E-314) in SQL Server database?
Thanks
Best Answer
None of the provided numeric types (
float
,decimal
) are able to store so small numbers. The example you have,2.466987305926227e-314
, is smaller than the smallest normal double-precision float number.I see two options, if you want to store such numbers:
Use a custom solution with two columns, one for the mantissa and another for the exponent. The disadvantage will be that you'll have to do all the math operators and functions with complex expressions (even for addition).
Use a custom CLR User-Defined Type. From that page: