Thursday, July 02, 2009 Register   Login   
   You Are Here: SQL Server Forums      

Submit Articles   |   Upload Scripts   |   Submit Tips   |   Start a Blog   |   Upload Tools   |  Post Job Openings   |   Submit Your Resume 

 

 SQL Server Discussion Forums

SQL Server Discussion Forums

Share
 
  SQL Server Forums  Discussions  SQL Server DBA ...  sql 2000 problem
Disabled Previous
 
Next Next
New Post 10/15/2007 6:48 AM
Resolved
User is offline colin leversuch-roberts
6 posts
No Ranking


sql 2000 problem 

I've moved a databse from prod to dev and a calculation on a sum of a float column gives a different value. There are approx 16k rows and here are the results ( so you can see the difference )
-648365.80999999424
-648365.81000000483

The data is identical as I've checked it, assuming data compare can be trusted < grin > and the dev db is a restored backup from production.

I seem to remember something about the float datatype from way back when, which is why i don't personally use it, however this is a client database. collation etc. is the same - anyone any ideas?

 
New Post 10/16/2007 7:11 AM
User is offline Michael Hotek
5 posts
www.mssqlserver.com
No Ranking


Re: sql 2000 problem 

A float is an approximately data type.  It will not produce the same results from one processor architecture to another and won't even necessarily do so from one machine to another.  In addition, you are using a float in computations, then you will be compounding rounding factors which magnifies the effect.  If you need the calculations to a high precision as well as also requiring them to be exactly the same regardless of machine or processor architecture, then you need to replace the float data type with a decimal data type.


Michael Hotek MCT, MCITP - SQL DBA
 
New Post 10/16/2007 8:27 AM
User is offline colin leversuch-roberts
6 posts
No Ranking


Re: sql 2000 problem 

thanks so very much - that was what I thought but couldn't find anything in my searches. I needed an outside confirmation from an "authority"  and who better than yourself.

thankyou

 
Disabled Previous
 
Next Next
  SQL Server Forums  Discussions  SQL Server DBA ...  sql 2000 problem
Share
  
 Recent SQL Server Discussions

Post byPosted onPostReply
Lisa Staples6/29/2009 7:16:00 AM Help...combining two existing reports where the da.. REPLY..
Manoj Misran6/28/2009 5:53:00 PM Selecting Distinct records.. REPLY..
jerome jourdon6/19/2009 3:46:00 PM Transaction consumption algorithm HELP.. REPLY..
suman das6/18/2009 6:24:00 AM getting no data fpr sp_spaceused in sqlserver 2000.. REPLY..
Rennuk Kunner6/15/2009 6:54:00 AM Where do i place the "exec" command to call a stor.. REPLY..
Cindy Gross5/26/2009 6:34:00 PM Re: Insert into question.... REPLY..
Cindy Gross5/26/2009 6:29:00 PM Re: Reboot Failed - Can't install SQL Server defau.. REPLY..
Cindy Gross5/26/2009 6:21:00 PM Re: Can SQL 2005 and 2008 co-exist?.. REPLY..
kerry corcoran5/11/2009 8:22:00 AM SQL 2000 (Clarification).. REPLY..
Jose Luis Garcia5/5/2009 8:45:00 AM Re: Windows group Dbowner .. REPLY..
moiz khan5/5/2009 2:29:00 AM Re: Windows group Dbowner .. REPLY..
Jose Luis Garcia5/5/2009 2:44:00 AM Windows Group DBowner .. REPLY..
Ramkumar Mohan4/29/2009 6:36:00 AM Insert into question.... REPLY..
Brad Bowman4/9/2009 11:15:00 PM Powershell 2.0 issues.. REPLY..
Mark Soule4/6/2009 7:36:00 PM HTTP 500 - Internal server error.. REPLY..
achyutha h3/24/2009 5:56:00 AM Unable to deploy analysis tutorial.. REPLY..
achyutha h3/24/2009 5:41:00 AM Unable to deploy analysis tutorial.. REPLY..
asif khan3/23/2009 12:48:00 PM Data transpose.. REPLY..
Stefan van de Griendt3/23/2009 7:13:00 AM Pausing Queries and/or Stored Procedures.. REPLY..
moiz khan3/17/2009 7:08:00 PM Re: views.. REPLY..
  
SQL Server  |  Events  |  SQL Server Forums  |  Articles  |  Scripts/Tools  |  Tips & Tricks  |  Blogs  |  Job Board  |  Videos
Copyright 2007 by www.sqlcommunity.com    Terms Of Use   Privacy Statement