Re: French, German, Italian SQL Query via ADO
- From: "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
- Date: Wed, 20 Jun 2007 12:35:13 -0400
No, the SQL-Query parser will keep the point (.) as the decimal separator.
You can easily verify that by setting your own WIndows machine to use the
comma instead of the point and make a test with SQL-Server.
Usually, when doing internationalisation, it's best to leave the conversion
between a characters string and a numerical value at the client side (many
client interfaces like .NET can automatically perform this kind of
conversion) and use only typed values to communicate with the SQL-Server.
The SQL-Server don't look at the regional options for most of its settings.
However, with each user (or login) account, there is a default language.
This is for formatting things like date or the default symbol for currency.
SQL-Server will use the default language association with the login or the
language that has been explicitely set; for example, run the following test:
set language english
select cast ('01-02-2007' as datetime)
set language french
select cast ('01-02-2007' as datetime)
Results:
2007-01-02 00:00:00.000
2007-02-01 00:00:00.000
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"UW" <UW@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0AC2EC12-A7F5-4C47-94E7-DD8789B190A7@xxxxxxxxxxxxxxxx
I am new to internalization and I have ran into a problem recently.
I have a SQL query generator which does something like:
1. Read double value from textbox
2. Convert it to double for some calculations.
3. Convert it back to string from double.
2. Attache the value to a SQL query
My question is when locale is FR or any country that uses comma(,) instead
of
period(.) for decimal does SQL Query parser magically takes decimal number
that is formated with comma? or do programmers from this country forced to
convert to period based numerics and run the query?
Obviously the code was developed in English only environment long time ago
and in the new environment evertyhing is locale set including DB
collation.
What do you think?
.
- Prev by Date: RE: Inserted Identity Values in SQL 2005
- Next by Date: appendChunk method resulting in incorrect data
- Previous by thread: Re: Adox Views in Access97
- Next by thread: appendChunk method resulting in incorrect data
- Index(es):
Relevant Pages
|
|