Microsoft Knowledge Base Email Alertz

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

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 917419 - Last Review: November 20, 2007 - Revision: 1.3

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

BUG #: 430091 (SQLBUDT)
BUG #: 430965 (SQLBUDT)
BUG #: 432476 (SQLBUDT)

On This Page

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.

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
Keywords: 
kbtshoot kbbug KB917419
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate