September 23, 2003 at 5:53 am
Hi,
I have a Server which is situated in USA and the data format is of USA. I need to have the application which is accessed from another country to display the data according to their format (For example in Germany the decimal is represented by a ','). How could I achive this? Any help is really appreciated.
Thanks in advance,
September 23, 2003 at 6:11 am
Where do you intend to display the data.
As far as I remember regional settings are used to display the data according to particular format.
He who knows others is learned but the wise one is one who knows himself.
He who knows others is learned but the wise one is one who knows himself.
September 23, 2003 at 6:20 am
Other than collations (used for strings), the data in SQL Server is not stored in any region-specific format. Your application should use the regional settings of the workstation. About the only issue may be the DATEFORMAT database option, which determines the order of dates presented to the server as '12/1/2003' types of strings. If you send the temporal data to the server in the ISO or ODBC canonical format, you'll be fine.
If you're basing your question on what you see in Query Analyzer, perhaps you need to check the "Use regional settings when displaying currency, number, dates and time" option in Tools|Options, Connections.
--Jonathan
--Jonathan
September 23, 2003 at 7:21 am
Thank you. The application is Visual Basic and the regional settings is creating another issue too. When a decimal is displayed as "," as I mentioned earlier, the SQL which runs will also have the same format like "select .... from ... where value = 2,3 and the server doesn't understand the , (actually it should be ".").
takeover
September 23, 2003 at 7:24 am
Do not send concatenated code like that from VB. Use typed parameters for the values, preferably with stored procedures. That will not only prevent these issues, but it will also increase the security of your application.
--Jonathan
--Jonathan
September 24, 2003 at 3:35 am
hi!
oh no - internationalization! don't worry, windows does it for you, and thats not a joke. you can simply test this: switch to eg. germany in your client pc's regional settings, and if you didn't hard-code something - voila, the decimal separator will be a comma.
should mean: you're using standard mechanisms for data access (eg. MDAC/ADO), the regional settings of your client machine will affect how the data (dates, separators, etc.) will be presented.
be careful just when using function that convert from formatted strings! rule: don't hard code format something let the system do. test your software by changing the regional settings of your client machine (ok, that's maybe something an american wouldn't think about 😉 just kidding).
best regards,
chris.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply