IN SQL Server資料庫
使用N如下
where col like N'%�%'
ofollow,noindex" target="_blank">
whydo you think ,you needN
prefix
:
Prefix Unicode character string constants with the letter N. Without the N prefix, the string is converted to the default code page of the database. This default code page may not recognize certain characters.
感謝馬丁·史密斯,早些時候我只測試了一個字元,它的工作,但正如馬丁指出,它返回所有字元..
以下查詢工作和返回只有意圖
select * from #demo where idlike N'%�%' COLLATE Latin1_General_100_BIN
演示:
create table #demo ( id nvarchar(max) ) insert into #demo values (N'ﬗ'), ( N'�')
要了解更多關於unicode,請看下面的連結
http://stackoverflow.com/questions/43474596/in-sql-server-database