关于字符集问题(Oracle 与 Sql Server的区别)?

cgsw12345 2006-06-16 12:08:42
我在Oracle中作过测试(Oracle字符集Unicode 标准 UTF-8 AL32UTF8)
一个表里面存有两条记录。简体与繁体
如:
userid username
001 中国
002 中國

在查询分析器中输入
select * from talbe where username like '%中国%' ->简体
select * from talbe where username like '%中國%' ->繁体

这两个Sql 语句在Oracle中能两条记录都查出。但在Sql Server 中就不行。
不知道Sql Server中有没有这样的功能,是不是跟字符集有关,该怎么设置?
...全文
219 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qingsongy 2006-06-18
  • 打赏
  • 举报
回复
select * from talbe where username like N'%中国%' ->简体
select * from talbe where username like N'%中國%' ->繁体
cgsw12345 2006-06-17
  • 打赏
  • 举报
回复
不行。UP!
擒兽 2006-06-17
  • 打赏
  • 举报
回复
mark
qingsongy 2006-06-16
  • 打赏
  • 举报
回复
try to use nvarchar instead of using char/varchar. set the collation name of the column: chinese_prc_ci_as, or Chinese_Taiwan_Bopomofo_CI_AS or chinese_prc_bin.
You should be able to insert 中国 and 中國 in the column. Not sure whether you can get the correct query result. Let me know if you have any problem or you need more information.

22,207

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧