(stefan.jansen@hagstofa.is) writes:
> I'm Running SQL 2005 and Microsoft SQL Server Management Studio
> (9.00.3042.00) and experiencing strange behaviour when results from my
> queries are displayed.
>
> My regional settings are set to Icelandic (comma as decimal separator
> and dot as thousand separators). Running the following queries
>
> SELECT CAST(5 AS NUMERIC(5,2)) / CAST(2 AS NUMERIC(5,2))
> SELECT 5.0 / 2.0
> SELECT CAST(5 AS float)/ CAST(2 AS float)
>
> Give me following results
>
> 2.50000000
> 2.500000
> 2,5
>
> Only the last one gives me the result according to my regional
> settings.
> Anyone else experienced similar problems and/or now a solution to this
> problem.
I reported this during the beta of SQL 2005, and the bug was closed as
"by design". I think the underlying problem is in SqlClient.
There is also the question of what result do we really want? That is,
do we want the comma or the period? I think I prefer the point, because
that works when I paste into a query window. Then again, comma works
better when you paste into Excel.
--
Erland Sommarskog, SQL Server MVP, esquel DeleteThis @sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx