• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 257
  • Last Modified:

Problem with viewing data in SQL Query Analyzer

Hi all,

I have a column type 'real' and it looks fine in the table when I view it in SQL Server Enterprise Manager, but when I pull it up as part of a query in Query Analyzer, the amount of digits is much larger after the decimal point than the original number stored in the table. I didn't do anything special to the column other than call it in the query.


For instance:

Enterprise manager                   Query Analyzer
=============            ================
745.590                                        745.59003


do I have to do anything special when I run a query to get it to look like it does in Enterprise Manager? I want to export the query to a text file, but am afraid that the output would contain the extra digits.

Thanks!
Kittrick


 
0
Kittrick
Asked:
Kittrick
  • 3
  • 3
  • 2
  • +1
1 Solution
 
rw3adminCommented:
AHA
0
 
KittrickAuthor Commented:
aha?
0
 
rw3adminCommented:
Sorry... I just wanted to say Aha before Acperkins beat me to this one as well, now atleast I have something submitted before him
your enterprise manager is rounding up the value and 745.59003 is the correct value.

0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
rw3adminCommented:
again I apologize I was just silly, for last 8 or 10 questions Anthony (acperkins) is beating everyone with an answer and I just jumped on this one... just for that you dont have to give me any points ...
EM will put its own formating in its grid for example a date will appear as '10/4/2000 4:38:43' but the actual date in QA is 2004-10-04 04:38:43.560 ....  so go with the data thats reported in QA, once you export this you will see the correct values in your data export as well


I will let some other expert take care of this.

rw3admin
0
 
KittrickAuthor Commented:
Yeah, that acperkins is quite fast. What I have in Enterprise Manager was imported from Access, so this is the number I need but it was automatically imported with the type 'real'. What should I do to get it to look like Enterprise Manager?
0
 
KittrickAuthor Commented:
No, you answered my question, I'll give you the points. Thank you very much!
0
 
Anthony PerkinsCommented:
>>do I have to do anything special when I run a query to get it to look like it does in Enterprise Manager?<<
Yes.  Replace all real (and float for that matter) columns with fixed length numeric columns.  Real (and float) are approximate data types are should IMHO never be used (unless you are into astronomy need large values and don't care if you are off by a couple of miles).
0
 
Anthony PerkinsCommented:
Real is analogous the the double data type that you have used in MS Access and VB.  It is based on IEEE format and is at best approximate.
0
 
AaronAbendCommented:
I agree - we need to pour some glue on ac's keyboard - he snapped 1000 points from right underneath me in 2 minutes... nice to know I'm not the only one left in the dust!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now