Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL LIKE statement using using unicode characters does not show correct result

I'm using SQL Server 2008 R2. I'm just wondering why this statement doesn't work correctly.

For example: The statement

WHERE CONTRACTORNAME LIKE '%á%' 

would gives me the correct result for every records containing "á". But the statement

WHERE CONTRACTORNAME LIKE '%ạ%' 

would not gives any records even though in CONTRACTORNAME column have a tons of records containing this character. Any help?

like image 455
user1507164 Avatar asked Jul 06 '12 15:07

user1507164


1 Answers

Try using a Unicode search string:

WHERE CONTRACTORNAME LIKE N'%ạ%' 
like image 155
Kevin Aenmey Avatar answered Sep 19 '22 22:09

Kevin Aenmey