Home > Archive > MS SQL Server Clients > June 2005 > foating numer









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author foating numer
Loui Mercieca

2005-06-01, 7:24 am

Hi,

I am using sql server 8. I have a table with a column whose data type is set
to Float with a length of 8. Whenever i am inserting the value ending in .1
it is storing the value .10000000000000001. Why is that?

Thanks


David Gugick

2005-06-01, 7:24 am

Loui Mercieca wrote:
> Hi,
>
> I am using sql server 8. I have a table with a column whose data type
> is set to Float with a length of 8. Whenever i am inserting the value
> ending in .1 it is storing the value .10000000000000001. Why is that?
>
> Thanks


FLOAT and REAL are approximate data types. If you want an exact data
type, use DECIMAL instead. See "float and real" in BOL.

--
David Gugick
Quest Software
www.imceda.com
www.quest.com

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com