Wednesday, March 7, 2012

God Only Knows Why???

CREATE TABLE [__1] (
[n] [int] IDENTITY (1, 1) NOT NULL ,
[a] [decimal](16, 5) NULL
) ON [PRIMARY]
GO

INSERT INTO __1
(a)
VALUES (1.22115)

select * from __1

------------
RESULTS FROM Query Analyzer
------------

(1 row(s) affected)

n a
---- ------
1.00 1.22

(1 row(s) affected)

When I go to the Enterprise Manager and see the data, it appears as

n a
---- ------
1.00 1.22115

I am soooo confused!! Highly appreciating your comments...try inserting 1.22000|||Originally posted by RaedT
CREATE TABLE [__1] (
[n] [int] IDENTITY (1, 1) NOT NULL ,
[a] [decimal](16, 5) NULL
) ON [PRIMARY]
GO

INSERT INTO __1
(a)
VALUES (1.22115)

select * from __1

------------
RESULTS FROM Query Analyzer
------------

(1 row(s) affected)

n a
---- ------
1.00 1.22

(1 row(s) affected)

When I go to the Enterprise Manager and see the data, it appears as

n a
---- ------
1.00 1.22115

I am soooo confused!! Highly appreciating your comments...
it gives right results for me.|||Karolyn:
After iserting 1.22000, nothing changed!
the output is still rounded to 1.22

harshal_in:
Notice the output from the Query Analyzer. The inserted value 1.22115 was rounded to 1.22, I need the Query Analyzer to give me what really exists in the table 1.22115, not 1.22!!

Originally posted by harshal_in
it gives right results for me.|||sorry I've mis-read your pb

it's the same pb as last week !

you must have a property or option in your QA that
rounds up your data

or maybe you don't see it totally... (?)

try

Select '-' + convert(varchar(50),a) + '-' From Table|||CREATE TABLE [__1] (
[n] [int] IDENTITY (1, 1) NOT NULL ,
[a] [decimal](16, 5) NULL
) ON [PRIMARY]
GO

INSERT INTO __1
(a)
VALUES (1.22115)

select 'Value = '+convert(varchar,a) from __1

What does this return ?|||Output:
------------
Value = 1.22115

? What does this mean?

Originally posted by Enigma

CREATE TABLE [__1] (
[n] [int] IDENTITY (1, 1) NOT NULL ,
[a] [decimal](16, 5) NULL
) ON [PRIMARY]
GO

INSERT INTO __1
(a)
VALUES (1.22115)

select 'Value = '+convert(varchar,a) from __1

What does this return ?|||that you don't see the all the numbers of your result

the column in the QA is too narrow
maybe there's an option to adapt the witdht of a column|||Just curious .. whats the version of sql query analyzer are you using ...
I found no option in QA that does rounding off :confused:|||Go see TOOLS-OPTIONS in the QA

in the Result tab there's a number of caracters

(maybe someone that doen't like you set it to 4)|||QA Version: 8.00.760
Max. Characters per column: 256

Note, even the int type value (1) appears as 1.00

Originally posted by Karolyn
Go see TOOLS-OPTIONS in the QA

in the Result tab there's a number of caracters

(maybe someone that doen't like you set it to 4)|||At least you've got the good result in the table...
(Being optimistic)

Check all the options in your databases and in QA|||how are you starting up your query analyzer ?

By clicking on an icon ? The only thing i can think of is that you might be starting up your qa with some configuration options

Check your shortcut properties ... the error might lie there|||I am starting my QA from the EM.

TOOLS=> SQL QA

Originally posted by Enigma
how are you starting up your query analyzer ?

By clicking on an icon ? The only thing i can think of is that you might be starting up your qa with some configuration options

Check your shortcut properties ... the error might lie there|||did you find the round-up-property ??|||I can go ahead of my work, I converted the decimal numbers to varchar, so I can get the results with 5 decimal places, but I am so frustrated and need to know why? I am so curious to know what the problem is.

Originally posted by Karolyn
did you find the round-up-property ??|||If you see BlindMan or Breitt Kaiser online
Ask them !!!|||I get

n a
---- ------
1 1.22115

(1 row(s) affected)

No way an int is decimal(5,2)

I checked the options for the result set and don't see anything...

What collation are you using...(doubt that that's it either)

I don't buy that a column defined like you posted will ever display an identity that way...|||Grasping at straws here, but Karolyn obligates me to respond...

What is your "Use regional settings when outputting currency, number, dates, and times" setting in QA options? (It's in the connections tab.)

If it is on, try setting it to off.

From Books Online:

"Use regional settings when outputting currency, number, dates, and times.
Turning this setting to ON causes the ODBC driver to respect the local client setting when converting numeric, date, time, and currency values to character strings. The conversion is from SQL Server native data types to character strings only. When the setting is OFF, the driver does not convert numeric, date, time, and currency data to character string data using the client locale setting. The conversion setting is only applicable to output conversion and is only visible when currency, numeric, date, or time values are converted to character strings (which is always the case with Query Analyzer). The default for this setting is OFF. "|||It's in

Tools>Options

Menu

Never even thought to look their...

if that's the case...

Why do people mess with ANY settings...I leave'em alone...

God, If I had to remeber what I set...I'd go crazy....

Certainly ups the Mriacle ante.....

as in "God only knows why"|||Blindman .. i believe you have hit the nail on the head ...|||If I did, it's only because it was the last thing that could be suggested!|||I never would have found that in QA. Good job, Blindman.|||Blindman, you deserve millions kisses. You are a superman.
Brett Kaiser: I did not get all what you posted, but I can smell the aggressive way in your reply. Sorry for INCONVENIENCE and thanks anyway.
Thank you all for help, now I can sleep well.|||Originally posted by RaedT
Blindman, you deserve millions kisses. You are a superman.
Brett Kaiser: I did not get all what you posted, but I can smell the aggressive way in your reply. Sorry for INCONVENIENCE and thanks anyway.
Thank you all for help, now I can sleep well.

Whatever...It was a stretch for us to figure out what happend...know why?

Because we never touch that stuff...

But it seems like someone did...why?

My point was exactly that...don't mess with the settings...|||still that agressive tone in your writing...|||I can't believe I got that one. Like I said, you guys had already eliminated everything else.|||Brett Kaiser: Man take a chill pill,
That option is set to ON by default after installation.

Originally posted by Brett Kaiser
Whatever...It was a stretch for us to figure out what happend...know why?

Because we never touch that stuff...

But it seems like someone did...why?

My point was exactly that...don't mess with the settings...|||"That option is set to ON by default after installation."

Really? I don't recall seeing that set to ON before. And I don't recall every changing it.|||RaedT
try and see if there's someone in your entourage
that doesn't like you
and put that option to ON|||That's because it's not....|||If setting that value to ON is somebody's idea of being malicious, they aren't very imaginative. It was probably set by accident, or there was a "reason for it at the time".

No comments:

Post a Comment