I have a database with Arabic_BIN collation on Microsoft SQL Server 2005.
If I run this query:
SELECT ID FROM maj_Users WHERE UserName = 'mahdi'
I’ll get nothing, but if I run this query:
SELECT ID FROM maj_Users WHERE UserName = 'Mahdi'
I’ll get a cell… Seems that SQL Server is searching database case-sensitively, but I want to search database case-insensitively.
Is there any way?
EDIT: Also I have tried SELECT ID FROM maj_Users WHERE UserName LIKE 'mahdi' but it didn’t work…
You can override a COLLATION defined on database or column level in a comparison using the COLLATE keyword:
To find collations for case-insensitive Arabic, use the query
Arabic_CI_AI or Arabic_100_CI_AI seems to be the right choice for you.