microsoft:sqlserver:notes:donotusefloat
Microsoft - SQL Server - Notes - Do not use float
Floats are approximate values and cannot store decimal values correctly.
This is seen most clearly when you use SQLCMD to export a table to CSV and find all your 2 decimal numbers looking like 4.0499999999999998.
SQL Server Management Studio has it's own way of showing you float row data where it does show 2 decimal numbers stored as float as a 2 decimal number.
Use numeric/decimal.
microsoft/sqlserver/notes/donotusefloat.txt · Last modified: 2018/09/06 17:39 by bas