Hebrew encoding in sql server2005

2020-02-15 01:47发布

i try this code in sql server 2005

declare @userName nvarchar(50)
set @userName='איש2'    
print @userName

but i get this

???2

what is the cause?

it look like it replace the Hebrew char to "?"

10x

1条回答
时光不老,我们不散
2楼-- · 2020-02-15 02:31

Use the N prefix so the string literal is interpreted as unicode not char under the code page of whatever your database's default collation is

declare @userName nvarchar(50)
set @userName=N'איש2'    
print @userName
查看更多
登录 后发表回答