views:

63

answers:

2

I have a value in the database which is 2.700000002. When I run a query in Management studio in SQL SERVER 2005 I get 2.7. But when I run in SQL SERVER 2000 query analyzer it comes 2.700000002.

2.70000002 is correct why is SQL SERVER 2005 trying to change the value by rounding it or selecting the floor value?

+2  A: 

Exactly the same target server, database, datatype, processor, architecture etc?

If not, it's simply how the tools will display an approximate float value

gbn
This seems as helpfull as the *approximate float value*
astander
Everything exactly the same but SS2005 displays 2.7 and SS2000 displays 2.700000002. Some sort of settings I need to change in SS2005?
azamsharp
A: 

Most things round off numbers for display.

~$ ghci
Prelude> 2.7
2.7
~$ irb
>> 2.7
=> 2.7
~$ python
>>> 2.7
2.7000000000000002

For interactive use, this is usually good enough — the only person to see the query analyzer is you, so why does it matter? For actual display, you should specify a format anyway. If you really need the exact value of "2.7", then you should be using a decimal type anyway, as countless articles and answers can tell you.

jleedev
That is not the question! The question is how do I get the same result in SS2005. SS2000 displays 2.70000002 which is what I want to see in SS2005!!
azamsharp
Why do you need to?
jleedev
@jleedev I just need to!
azamsharp