Using LIKE operator with arabic in SQL Server

Last Reply 5 months ago By pandeyism

Posted 5 months ago

how to select matching data from from sql that the table has arabic names

I have used several condition in whare clause like below

LIKE '%'+ @myUser + '%'

LIKE N'%'+ @myUser + '%'

but couldn't return any rows

Posted 5 months ago Modified on 5 months ago

Hi satabeach,

Refer below sample query.

SQL

DECLARE @FilterDataInArabic AS TABLE(Name NVARCHAR(MAX))
INSERT INTO @FilterDataInArabic VALUES(N'لا أتكلم العربية')
INSERT INTO @FilterDataInArabic VALUES(N'ل أتكلم العربية')

SELECT * FROM @FilterDataInArabic
WHERE Name LIKE N'لا%'