SQL Server datatype precision - Neo, what is real?

后端 未结 3 1930
北海茫月
北海茫月 2021-01-25 00:37

SQL Sever 2000 documentation:

Is a floating point number data with the following valid values: –3.40E + 38 through -1.18E - 38, 0 and 1.18E - 38 thr

3条回答
  •  无人及你
    2021-01-25 01:03

    SQL Server uses either 4 bytes or 8 bytes to store non-decimal floating point numbers.

    If you specify real or any value in the range float<1> to float<24>, SQL server uses float<24> internally. If you use float or anything in the range float<25> to float<53> (the limit), it uses float<53> which is otherwise known as double precision.

    MSDN documentation for float in SQL Server 2005 is here: float and real (Transact-SQL)

    If you have a specific precision need, look instead at using decimal, which provides configurable precision and scale: decimal and numeric (Transact-SQL)

提交回复
热议问题