We usually use N for unicode string literals like this:
Select *
From Customer
Where Name = N'កខគ' --Unicode
Now I want to change it to be like this:
Declare @a varchar(Max)
Select *
From Customer
Where Name = N''+@a
At the second SQL statement it doesn't work at all. Any ideas? Thank you in advance.
The N is only used as a prefix to coerce unicode literals. If your @a variable is already one of the unicode types (e.g. NVARCHAR) then it's not necessary to convert or coerce it in any way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With