Andrey Andrey - 4 months ago 11
SQL Question

LIKE pattern for kazakh symbols

I try to select names that contain kazakh symbols with this query:

select * from tbl where FirstName like N'%[ӘәҒғҚқҢңӨөҰұҮүҺһІі]%'


It is working properly for some names. But not for 'Ә' symbol. For example,
name = 'ӘСЕМ'
is not found by pattern
like N'%[Ә]%'
but pattern
like N'%Ә%'
working fine.

Why pattern with square brackets (
like N'%[Ә]%'
) do not works for symbol
'Ә'
?

Answer

Specify the collation explicitly:

select * from tbl 
where FirstName like N'%[ӘәҒғҚқҢңӨөҰұҮүҺһІі]%' COLLATE Kazakh_90_CI_AS
Comments