Revolving around the core of technology
We are noticing that float column values with high precision in our Sql Server database are not displaying accurately and would like to know if it is a bug or something we can adjust in our client settings.
Our table has a column of type float, size 15, scale 0, and ordinal position 7. When I insert a value of 0.01603821694 and then query the table with WinSql it displays as "1.6038216939999999E-2". When we insert the value 32.5358601551383, WinSql displays it as "32.535860155138302".
We checked the table values using the Sql Server client tools and the data looks correct.
Clint,
Before displaying the results on the screen, WinSQL asks the ODBC driver to convert a floating point to string. For some reason the precision is lost during this conversion. However, if you ask the server to do the conversion, you will be able to get the right value. Try the following query:
select col1, convert(varchar(50), col1, 2) from YourTable
Imran
That works, thank you! Do you have any plans for supporting native drivers and moving away from ODBC?