Waleed Ali
Waleed Ali

Reputation: 21

String have special characters in SQL

I want following string to store in variable but It's giving error in SQL Server.

DECLARE @string nvarchar(max)

set @string=''˗ˏˋmichaelˎˊ˗''

Upvotes: 0

Views: 483

Answers (1)

Sean Lange
Sean Lange

Reputation: 33581

The ' is a string delimiter in t-sql. If you want to include that character in your string you need to double them. You also need to specify that your string literal is nvarchar by preceding the string with N.

DECLARE @string nvarchar(max)

set @string= N'''˗ˏˋmichaelˎˊ˗'''

select @string

Upvotes: 3

Related Questions