Query for answers ae æ in SQL Server / LINQ to SQL

When I try to run ...

SELECT * FROM Users WHERE Username = 'ae' it returns matches where username is æ (ash character).

I was wondering if there is a way to support characters like ashes, but get an exact exact match for what I'm looking for.

I would like to find ae and get just ae, not ae and æ

I am using SQL Server 2008 and SQL Server 2008 R2.

+6
c # sql sql-server-2008 linq-to-sql windows-server-2008
source share
2 answers

This is not like SQL mappings

 ;with Users As ( select 'æ' as Username UNION ALL SELECT 'ae' ) SELECT * FROM Users WHERE Username = 'ae' collate SQL_Latin1_General_CP1_CI_AS 
+2
source share

For comparison, you can use ordinal matching. For example:

 SELECT * FROM Users WHERE Username = 'ae' COLLATE Latin1_General_BIN 
0
source share

All Articles