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

北城余情 提交于 2020-01-03 11:26:20

问题


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?


回答1:


Try using a Unicode search string:

WHERE CONTRACTORNAME LIKE N'%ạ%' 


来源:https://stackoverflow.com/questions/11365304/sql-like-statement-using-using-unicode-characters-does-not-show-correct-result

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!