日期:2014-05-18  浏览次数:20383 次

sqlserver 2005 中文字符查询问题
在本地机器上是好的,把数据导到服务器上出现问题,
查询中文字符总是查不到相应的结果
比如一张news表里包含一条新闻标题为 "06年全国中等职业学校毕业生就业率达到95.6% "的数据,用查询语句   select   title   from   news   where   title   like   '%95.6% '就能查询到这条数据;而用select   title   from   news   where   title   like   '%毕业生% '就查不到这条数据
请问这个问题怎么解决?

------解决方案--------------------
select title from news where title like N '%毕业生% '
------解决方案--------------------
--因为你定义的是nvarchar,需要将串转换为Unicode字符

select title from news where title like N '%毕业生% '

------解决方案--------------------
字符集的问题,用
select title from news where title like N '%毕业生% '