Full precision output of floating point types in SQL Server Management Studio

后端 未结 3 707
北海茫月
北海茫月 2020-12-06 18:08

I have the value 1555.4899999999998 stored in a float column with default precision (53). When I do a simple select, SSMS rounds the

3条回答
  •  情歌与酒
    2020-12-06 18:41

    No.

    SQL Server Management Studio rounds floating point values for display purposes; there is a Connect suggestion to change this behavior, but it is closed "as By Design". (Microsoft Connect, a public issue tracker for Microsoft software has been retired)

    However, SQLCMD, osql and the Query Analyzer do not.

    SQLCMD -E -S server -Q"SELECT CONVERT(FLOAT, 1555.4899999999998)"
    

提交回复
热议问题