Kai
Kai

Reputation:

SQL Query with accents from Foreign Languages

I have a simple column filled with words, many from foreign languages,

I need to query based on the "English" letters,

ie E, e, é, è, etc should be returned for query of "E"

so école should be returned as a result which exists in the database when I query for "E"

I can't really find a way to Google this, so help would be greatly appreciated.

I'm using MSSQL 2005.

Upvotes: 2

Views: 2941

Answers (2)

SQLMenace
SQLMenace

Reputation: 134941

choose a collation which is insensitive to accented characters

example

create table bla(Col nvarchar(30))

insert bla values (N'E')
insert bla values (N'e')
insert bla values (N'é')
insert bla values (N'è')
insert bla values (N'f')
insert bla values (N'k')


select * from bla where Col = 'e'  --won't work

select * from bla where Col = 'e' collate Latin1_General_CI_AI_WS

Upvotes: 1

BC.
BC.

Reputation: 24908

Change your collation to be accent-insensitive.

Upvotes: 1

Related Questions