[thelist] accent insensitive queries in sql server

kasimir-k kasimir.k.lists at gmail.com
Fri May 4 08:01:22 CDT 2007


Sarah Adams scribeva in 04/05/2007 12:39:
> I'm trying to figure out how to write a search query for SQL Server that
> will be accent insensitive. For example, say I want to do this query:
> 
>  SELECT docid, title, author
>    FROM documents
>   WHERE author LIKE '%rene%'
> 
> I want to make sure it will return documents with an author named
> "Renée" or "Irene". I've done a lot of Googling, and it seems that the
> query isn't working as I'd like it to because of the collation on the
> database, which is SQL_Latin1_General_CP1_CI_AS - the "AS" at the end
> meaning "accent sensitive". 

Haven't used SQL Server in ages, but how about:
WHERE (author COLLATE QL_Latin1_General_CP1_CI_AI) LIKE '%rene%'

.k



More information about the thelist mailing list