Problem select ... where col like 'CCI%' with SQL_Slovak_Cp1250_CI_AS collation - by skyfun

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 779746 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 2/21/2013 1:40:57 PM
Access Restriction Public


Following select causes wrong result, if is used collation SQL_Slovak_Cp1250_CI_AS or SQL_Czech_Cp1250_CI_AS.

select * from tab where col1 like 'CCI%'

If is used collation Slovak_CI_AS, SQL_Polish_Cp1250_CI_AS or other result is correct.
If is used nvarchar instead of varchar for column type result is correct.
If is used similar expression ( 'ZCI%' ) the result is wrong again.

This may be due to the different order of the letters in the Slovak or Czech alphabet. Leter order is A, B, C, D, E, F, G, H, CH, I, J ...

I tried the following versions SQL Server 2005, 2008, 2012. 
Sign in to post a comment.
Posted by Microsoft on 3/8/2013 at 11:51 AM
Thanks for reporting the issue. This is a bug that exists in all current versions of SQL Server for SQL collations, char/varchar columns and LIKE operator. The SQL collations that are affected are specifically those with double-byte characters like CH, ZH that are considered single characters and sort along with the Latin characters.
Given the nature of the problem (existence in all versions) and our current priorities we will not be fixing this bug. The workaround to avoid the optimization that can result in the incorrect results is do below:

where col1 + '' like 'CCI%'

Umachandar, SQL Programmability Team