[freetds] FreeTDS and numeric fields in MSSQL2005 database

Thomas Stover thomas at wsinnovations.com
Thu Feb 18 13:36:19 EST 2010

> From: Michal Seliga <michal.seliga at visicom.sk>
> hi
> I just noticed that numerical values differ when i connect to the same
> database
> from windows (using microsoft driver) and from linux (using freetds
> i work with them as with text (which means no conversion is done and i
> exactly what is read from database, i checked qt sources to make sure
> this
> is how it works)
> values are mathematically the same, but format is a bit different. for
> example
> same value is read in windows '.0000' and in linux '0.0000'. and also it
> seems
> that for colum which is for example numeric(16,4) in windows returned
> value may
> have less decimal places then 4, while in linux there are always 4
> is there any conversion made by FreeTDS? (or maybe by microsoft driver?)
> can i
> be sure that i won't get different values when working from different
> environments?
> so far its not an issue, i am only curios if i can expect problems in
> future or
> I may forget about it
> btw current cvs version is great, all issues i used to have are gone
> there
> is one but foe now i think its problem of qt and not of freetds).
> congratulations!

When you say "work with them as text", does that mean the column type is
text or a numerical type? A numerical type is going to be converted
somewhere along the line for sure if you go from text and back. 

This is somewhat related to the problem of converting in and out of base 2
floating point variables.


More information about the FreeTDS mailing list