Microsoft KB Archive/917419

= BUG: The datetime data type and the smalldatetime data type are always evaluated by using the us_english language environment when you use the CREATE PARTITION FUNCTION statement in SQL Server 2005 =

Article ID: 917419

Article Last Modified on 11/20/2007

-

APPLIES TO


 * Microsoft SQL Server 2005 Standard Edition
 * Microsoft SQL Server 2005 Standard X64 Edition
 * Microsoft SQL Server 2005 Standard Edition for Itanium-based Systems
 * Microsoft SQL Server 2005 Enterprise X64 Edition
 * Microsoft SQL Server 2005 Enterprise Edition for Itanium-based Systems
 * Microsoft SQL Server 2005 Enterprise Edition
 * Microsoft SQL Server 2005 Developer Edition

-



BUG #: 430091 (SQLBUDT)

BUG #: 430965 (SQLBUDT)

BUG #: 432476 (SQLBUDT)



SYMPTOMS
When you use the CREATE PARTITION FUNCTION statement to create a partition function in Microsoft SQL Server 2005, the datetime data type and the smalldatetime data type are always evaluated by using the us_english language environment. This problem occurs when the language environment for the SQL Server 2005 session is not set to the us_english language environment.

Note This problem does not occur when the language environment for the SQL Server 2005 session is set to the us_english language environment.



WORKAROUND
To work around this problem, use one of the following methods.

Method 1
Use the multilanguage  format for the datetime data type and for the smalldatetime data type. For example, use the following code example to work around this problem. CREATE PARTITION FUNCTION pf (datetime) AS RANGE RIGHT FOR VALUES ('20051231','20061231');

Method 2
Explicitly call the CONVERT function, and provide a date format style. For example, use the following code example to work around this problem by using style 104 for the German date format. CREATE PARTITION FUNCTION pf (datetime) AS RANGE RIGHT FOR VALUES (   convert(datetime, '31.12.2005', 104),            convert(datetime, '31.12.2006', 104));



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Keywords: kbtshoot kbbug KB917419

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.