SQL Server search in nvarchar & ntext

混江龙づ霸主 提交于 2019-12-01 06:09:43

You should use the N' prefix to indicate that you're searching for a Unicode string:

SELECT * FROM dbo.tblArticle WHERE name LIKE N'%......%'

Otherwise, you're converting your search string back to non-Unicode and then searching....

Reagan

You must use COLLATE Latin1_General_BIN2 to get results. Works for Amharic for Ethiopians.

Select * From YourTableName where ColNameYouSearch LIKE N'%YourSerchCriteria%' COLLATE Latin1_General_BIN2"
mithilatw

I am not familiar with C# ASP.NET, but using nvarchar or ntext shouldn't make any difference in query type. I am wandering you are only assigning your query command to a variable and not executing it.. should you do something like myCommand.execute() ?

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