Sql server 2005 在SQLServer2005中使用Macron
我有一个表,它的模式是Sql server 2005 在SQLServer2005中使用Macron,sql-server-2005,tsql,Sql Server 2005,Tsql,我有一个表,它的模式是 declare @tbl table(field varchar(20)) insert into @tbl select 'Pāo' union all select 'Paorum' union all select 'Some Pao' union all select 'Pao' 如果我只想在macron上搜索记录,我无法这样做 select * from @tbl where field = 'Pāo' 输出: field Pao Pao 如果我使用
declare @tbl table(field varchar(20))
insert into @tbl
select 'Pāo' union all select 'Paorum' union all select 'Some Pao' union all select 'Pao'
如果我只想在macron上搜索记录,我无法这样做
select * from @tbl where field = 'Pāo'
输出:
field
Pao
Pao
如果我使用like运算符,例如(比如“%pāo%”),我将获得所有记录
我只对马克龙领域感兴趣
怎么做?在谷歌搜索之后,我甚至尝试过用nvarchar代替varchar,但没有任何改进
请帮忙
谢谢您需要使用unicode:
declare @tbl table(field nvarchar(20))
insert into @tbl
select N'Pāo' union all
select N'Paorum' union all
select N'Some Pao' union all
select N'Pao'
select * from @tbl where field = N'Pāo'
您需要使用unicode:
declare @tbl table(field nvarchar(20))
insert into @tbl
select N'Pāo' union all
select N'Paorum' union all
select N'Some Pao' union all
select N'Pao'
select * from @tbl where field = N'Pāo'