sql - Inconsistent DATETIME/FLOAT conversion with CONVERT when user language not English -


I have some problems with SQL Server 2005 and SQL Server 2008 when working with those values ​​which compare to German In German there is a different representation. Servers and OS are running as German versions.

  SET LANGUAGE deutsch; Convert (Node Time, 'December 31, 1999'), Convert (Navratra, Convert (Datetime, '31 December 1999')), Convert (Float, '3.14159') as P, Convert (Navrekar, Convert (float, '3.14159')) Q;   

Output is in the management console:

  a = 1999-12-31 00: 00: 00.000 b = dz 31 1999 12:00 am = 3,14159 d = 3.14159 dateformat = dmy   

This is incompatible (A) Representation of German of December-31-1999 was correctly parsed And is displayed (and only German work ..) with a convert, clearly changing the same date returns a string which English date format German short month The names of (This is not "December 31" "December 31" if you look closely).

But P is converted to a string in english notation (decimal point) in a float, even then German is displayed in the notation (Using the decimal property), while the number of clear conversions for the newcomer again English in the notation does not accept the input in the German signaling for the conversion of the float to the Otto Convert ().

Then, I have a converter function:

  1. To convert the wire to <
  2. Accepting the string for conversion in
  3. and
  4. and
  5. .
  6. Converts datetime values ​​to both the mixture of nvarchar and German and English .
  7. English

    Converts float values. But whatever I need is the function of SQL Server 2005, 2008 which changes text from the current user language to the values ​​of supported types (data time, floats ...) and these values ​​are represented in text representation in the context of the current user language Changes.

    What is this function?

    [S] consolidate the language environment for the session Does. Session language determines daytime formats and system messages.

    Setting the style parameter of function 120 supports language-independent conversion.

    For conversion of float values ​​

    Normally, you should avoid language-specific formatting in the database and implement it in the UI.

Comments