简体   繁体   English

sql中的越南字符选择像

[英]Vietnamese characters in sql select like

When I search with the following query 当我使用以下查询进行搜索时

Select * From [table] WHERE Name like '%Hà Nội T&T%'

in my mssql database I get no results , even though I'm sure it exists in the db. 在我的mssql数据库中,我no results得到no results ,即使我确定它存在于数据库中。

I seem to have trouble with characters like ộ, ẫ, and Đ . 我似乎对ộ, ẫ, and Đ等人物有困难。

I have tried changing collation-settings but nothing helps. 我尝试过更改校对设置,但没有任何帮助。

Any suggestions? 有什么建议么?

尝试:

Select * From [table] WHERE Name like N'%Hà Nội T&T%'

You need to alter your column containing Vietnamese characters. 您需要更改包含越南字符的列。

ALTER TABLE [table] ALTER COLUMN name NVARCHAR(100) COLLATE Vietnamese_CI_AS

And then do 然后呢

SELECT * FROM [table] WHERE name LIKE '%Hà Nội%' 

SQL FIDDLE DEMO SQL FIDDLE DEMO

Try changing connection encoding using: 尝试更改连接编码使用:

SET character_set_client = charset_name;

Also please do not use Latin1 encoding, try switching to UTF8. 另请不要使用Latin1编码,尝试切换到UTF8。 Here is a FAQ for Vietnamse Unicode: http://vietunicode.sourceforge.net/main.html 这是Vietnamse Unicode的常见问题解答: http//vietunicode.sourceforge.net/main.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM