Connecting Tech Pros Worldwide Help | Site Map

Inconsistent results for SELECT SUM(<<real field>>) ...

rnhuch
Guest
 
Posts: n/a
#1: Sep 26 '08
My platform is SQL Server 2005. One of the tables of my db has
28589928 rows and one of the fields is real. When I backup and restore
this database to another server (using the SQL Server internal tool)
and do a SELECT SUM(<<field name>>) from <<table name>>, the results
from these two servers are slightly different. I don't understand the
reason because these databases are static and they should be exactly
the same.

Then when I tried to run the above select on the same server a few
times in a row, I also had inconsistent results (and no user is
accessing the database). This doesn't make any sense to me...
Plamen Ratchev
Guest
 
Posts: n/a
#2: Sep 26 '08

re: Inconsistent results for SELECT SUM(<<real field>>) ...


The FLOAT/REAL data type is approximate, and as such not all values in
the data type range can be represented exactly.

Interesting readings on the topic:

http://blogs.msdn.com/khen1234/archi...13/417153.aspx
http://sqlblog.com/blogs/hugo_kornel...all-exact.aspx
http://msdn.microsoft.com/en-us/library/ms173773.aspx

--
Plamen Ratchev
http://www.SQLStudio.com
Closed Thread