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 (917419)



The information in this article applies to:

  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Standard X64 Edition
  • 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 YYYYMMDD 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 "Applies to" section.

Modification Type:MajorLast Reviewed:6/2/2006
Keywords:kbtshoot kbbug KB917419 kbAudDeveloper