Jakub Bares
Jakub Bares

Reputation: 159

SELECT WHERE LIKE returns incomplete results and the reason is not diacritics

I am searching for results WHERE name LIKE '%Soucek%' (or I tried '%Souček%' or '%Soućek%'. I get one result. (I set the whole column to be COLLATE SQL_Latin1_General_CP1251_CI_AS). If I search for '%Sou_ek%' i get all results there are. I dont understand what is going on. Do you have an idea?

Upvotes: 0

Views: 103

Answers (1)

jbertrand
jbertrand

Reputation: 148

Consider using AI : "Accent Insensitive" instead of AS : "Accent Sensitive".

Also, make sure that both sides have the same collation to avoid errors or further coercions :

WHERE name COLLATE Latin1_General_CI_AI Like '%Soucek%' COLLATE Latin1_General_CI_AI

Upvotes: 1

Related Questions