Best regards,
Simon
What is funny, is the consistency. Try this:
select convert(float, 10.12), convert(decimal(5, 2), 10.12)
--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
The *real* answer to be honest is to store the data in it's native
format and then do any conversion necessary at the client. You won't
run in to any issues w/ sorting or precision that way.
Good luck...Troy
Errr ... Management Studio IS the client in this case, and it appears
the OP is out of luck.
Is there a Connect entry on this issue? There should be.
--
HTH,
Bob Barrows
>simon (zupa...@gmail.com) writes:
>> In SQL 2008 server managment studio I have reults of my query shown in
>> grid.
>> The decimal numbers are shown with decimal point, like this: 10.05
>> I would like to set that decimal separator is comma, not point, like
>> this: 10,05
>> How can I do that? Because in my language the points are thousand
>> separators and comas are decimal separators.
>
>I don't think this is possible. Query Analyzer in SQL 2000 had a setting
>where you could opt for regional settings to be honoured. (Which I never
>used.)
I thought I would have go at this. I changed my region to French
(French), started SSMS, and did a simple query of select 1.7+2.5. The
result was 4.2 not 4,2. I even tried rebooting in case the effect was
delayed. No go.
I am running Windows XP Home and SSE 2008.
>What is funny, is the consistency. Try this:
>
>select convert(float, 10.12), convert(decimal(5, 2), 10.12)
Why is this odd? It is what I would expect.
Sincerely,
Gene Wirchenko
Hi Simon,
I realise it's not exactly the answer you are looking for, but if I
ast the values to float, AND choose output to text rather than output
to grid, I do get a decimal comma.
--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Hi,
thank you all for your answer. Obviouslly, there is no solution.
I changed the language of connected user to Slovenian and still the
same.
In database I have decimal number type.
If I select it and cast it into float than I get decimal comma, also
works if in database is float column.
But I have decimal data types in my database and I won't want always
cast all decimal columns into float because of comma.
regards,
Simon
I don't know what you see, but I see this:
10,12 10.12
I don't know why I should expect this, but I don't.
Although, I believe the difference is due to different implementations
for .ToString() for the corresponding data types in .Net; I think I've
seen similar inconsistences with C# code.
I did report this during the Yukon beta, but the bug report was promptly
closed, and I found more important battles to fight.
>Gene Wirchenko (ge...@ocis.net) writes:
>>>select convert(float, 10.12), convert(decimal(5, 2), 10.12)
>>
>> Why is this odd? It is what I would expect.
>I don't know what you see, but I see this:
>
> 10,12 10.12
I see "10.12" and "10.12". I checked this yesterday. I checked
it again just now. Commas need not apply.
>I don't know why I should expect this, but I don't.
I have figured it out somewhat. I run with the English (Canada)
region settings slightly modified (but not for numbers). I switched
to French (France), started SSMS, and tried the query. I then saw
what you saw.
>Although, I believe the difference is due to different implementations
>for .ToString() for the corresponding data types in .Net; I think I've
>seen similar inconsistences with C# code.
>
>I did report this during the Yukon beta, but the bug report was promptly
>closed, and I found more important battles to fight.
It appears that displaying a number is done with decimal points
regardless of region, but converting to a string respects the region.
I did not see if SSMS would pick up such a setting change or just
goes with what was in effect when it started, and I did not try
anything else similar.
Sincerely,
Gene Wirchenko