【发布时间】:2015-02-17 16:37:32
【问题描述】:
SQL Server 2008 R2
create table #test (c1 nvarchar(5) not null)
insert into #test values
(N'aaa'),
(nchar(65533)),
(N'bbb')
select * from #test where c1 like N'%�%'
select * from #test where c1 like N'%'+nchar(65533)+N'%'
结果是
c1
----
aaa
�
bbb
为什么?我在 MSDN 中没有找到关于这个案例的任何注释。
【问题讨论】:
-
我已经用 sql fiddle 检查过一切都很好;sqlfiddle.com/#!3/fde76/3
-
可能是你的
collation你的tempdb数据库排序规则是什么? -
Alsin,如果您有兴趣,我刚刚更新了我的答案以更清晰。
标签: sql-server tsql unicode sql-like