Article ID: 290921 - View products that this article applies to.
This article was previously published under Q290921
BUG #: 351791 (SHILOH_bugs)
When the UPPER or LOWER function is used on a column, the result set will have metadata that is twice the length of the string. This is the expected behavior on a double-byte character set (DBCS) collation, which could potentially have 2 bytes per character and where the number of bytes for a character could change based on the case. However, it is not expected behavior for single-byte character set (SBCS) collations.
The UPPER and LOWER functions assume that the number of bytes in the result set could always be twice the number of characters, even in an SBCS environment.
To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/290211/EN-US/ )INF: How to Obtain the Latest SQL Server 2000 Service Pack
Use the CAST or CONVERT functions to result in the corrent metadata length; for example:
Microsoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.
To reproduce the problem, execute the following query: