Groups | Blog | Home
all groups > sql server new users > december 2004 >

sql server new users : Real data type



David Clifford
12/3/2004 11:18:50 AM
Hello .

I have just migrated a rather large QA database to SQL server 7..the one
that came free with VB6 pro. I am really quite new to SQL Server.
My question is:
Many fields contain laboratory results for analytes that were stored as
single data types in Jet 4.0 Typically the results would be 1.23, 1.45,
3.66, 2.66, 1.55, 1.52 etc etc. Mostly 2 decimal places. My conversion to
SQL server 7 has assigned these single data types as Real. Looking at my
reference book, it says not to use this data type as it can be inaccurate.
The book recommends Decimal, Money or Small Money data types. However, at 2
decimal places, how inaccurate would it have to be? So, my question is, as
it is not recommended to use the Real data type, what data type should I use
to store these values?

Thank you for your time.

Mike Epprecht (SQL MVP)
12/3/2004 5:07:30 PM
If you need exact, use decimal.

With real, you could have a scenario where 1.2999999999999999999 is used
instead of 1.30

Regards
--------------------------------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland

IM: mike@epprecht.net

MVP Program: http://www.microsoft.com/mvp

Blog: http://www.msmvps.com/epprecht/

[quoted text, click to view]

David Clifford
12/3/2004 9:47:49 PM
Thank you Mike, Decimal it is.

Best regards. David Clifford


[quoted text, click to view]

AddThis Social Bookmark Button