Arabic name query returns more then one results

Viewed 148

I have a situation when doing a simple select query with a specific arabic name like the following "رفعة" the query returns more then one results. It rightly returns "رفعة", but it also returns "رفعت".

SELECT * FROM Table where ArabicName = N'رفعة'

I have encountered two other situations as well. When querying with "حياة" it returns "حياة" and "حيات". When querying with "نعمة" it returns "نعمة" and "نعمت".

I have searched online for answers, but without luck.

Has anyone encountered this situation before?

2 Answers

I was able to fix the issue by adding the following to the query: COLLATE Arabic_100_CI_AS

SELECT * FROM Table where ArabicName COLLATE Arabic_100_CI_AS = N'رفعة'

Nb! It did not work without specifying the _100_ in the collation specification.

Your problem is related to collation and you should understand what that means especially last few letters in collation Arabic_100_CI_AS.

CI means case insensitive, also you have option to set CS which means case sensitive

AS means accent sensitive, same as case there is option AI which means accent insensitive

Well, this collation can be set on server, database, column level or you can explicitly search adding COLLATE command at the end of statement.

Related