Declare @Topic nvarchar(2000) ='.کثیر الانتخاب جواب میں سے صحیح جواب منتخب کیجئے'
SELECT TextbookTopicId,Title FROM TextbookTopic tt WHERE tt.Title =@Topic
I declared a variable and use in where clause but its not working. but if i use 'N' and remove variable from where clause and use text directly in where clause then it works fine
SELECT TextbookTopicId,Title FROM TextbookTopic tt WHERE tt.Title =N'.کثیر الانتخاب جواب میں سے صحیح جواب منتخب کیجئے'
You need the
N
before the constant:Otherwise, the value is a
varchar()
constant that gets converted tonvarchar()
.