Muneer Jani
Muneer Jani

Reputation: 39

Append N Unicode to string literal

I have below problem.When we write a query as below the below output gives question mark.

Scenario 1

declare @input NVARCHAR(2000)='اتحاد'
SELECT @input

output

?????

Scenario 2

declare @input NVARCHAR(2000)=N'اتحاد'
SELECT @input

output

اتحاد

Let me know how to append N literal dynamically as below

declare @input NVARCHAR(2000)='اتحاد'
SET @input =N''+ @input

but the above yields:

?????

Upvotes: 2

Views: 150

Answers (1)

Tonner Mààn
Tonner Mààn

Reputation: 133

Unfortunately you can not change how the value was interpreted AFTER it's stored, so you MUST use Scenario 2 if you don't want to get question marks.

Upvotes: 1

Related Questions