Aya Ka
Aya Ka

Reputation: 49

can't distinguish some arabic characters when querying in sql server

when I search about some arabic words in sql server , it doesn't distinguish between 'ة' and 'ت' and it shows them all

like in this picture

enter image description here

Upvotes: 4

Views: 1784

Answers (2)

Nawaf
Nawaf

Reputation: 540

Try to use N in your query to tell the sql engine that the following string is UNICODE.

WHERE EMP_FIRSTNAME = N'نعمت'

Here the function that convert the first letter only to Unicode. Both letters has a different code so it is weird how this happens with you.

DECLARE @STRING NCHAR(20) , @STRING1 NCHAR(20)
SET @STRING = N'ت'
SET @STRING1 = N'ة'
SELECT UNICODE(@STRING),@STRING , UNICODE(@STRING1) , @STRING1 

Upvotes: 1

Yogesh Sharma
Yogesh Sharma

Reputation: 50163

Try to collate them as

where emp_firstname collate Arabic_BIN = N'نعمت'

Upvotes: 2

Related Questions