Handling unicode characters that aren't displayed correctly in SQL query

后端 未结 3 1558
长情又很酷
长情又很酷 2021-01-21 18:44

Here is the SQL query:

DECLARE @objname nvarchar(255)
set @objname=\'漢字\'
select @objname

When I run this query in Microsoft SQL Server Managem

3条回答
  •  滥情空心
    2021-01-21 19:13

    NVarchar variable are denoted by N' so it would be

    DECLARE @objname nvarchar(255)
    set @objname=N'漢字'
    select @objname
    

    Now the output will be 漢字 as it has been set. Run above code.

提交回复
热议问题