Solved

Problem with viewing data in SQL Query Analyzer

Posted on 2006-10-31
9
253 Views
Last Modified: 2012-06-27
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
Comment
Question by:Kittrick
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 11

Expert Comment

by:rw3admin
ID: 17846559
AHA
0
 
LVL 4

Author Comment

by:Kittrick
ID: 17846568
aha?
0
 
LVL 11

Expert Comment

by:rw3admin
ID: 17846576
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
Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

 
LVL 11

Accepted Solution

by:
rw3admin earned 500 total points
ID: 17846632
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
 
LVL 4

Author Comment

by:Kittrick
ID: 17846645
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
 
LVL 4

Author Comment

by:Kittrick
ID: 17846659
No, you answered my question, I'll give you the points. Thank you very much!
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17846660
>>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
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17846670
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
 
LVL 10

Expert Comment

by:AaronAbend
ID: 17846863
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question