Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old September 26th, 2008, 07:45 PM
rnhuch
Guest
 
Posts: n/a
Default Inconsistent results for SELECT SUM(<<real field>>) ...

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...
  #2  
Old September 26th, 2008, 08:05 PM
Plamen Ratchev
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles