[thelist] accent insensitive queries in sql server

Sarah Adams mr.sanders at geekjock.ca
Fri May 4 11:19:07 CDT 2007

>> 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%'

Thanks so much, kasimir! I had tried something sort of like this, but my
syntax must have been off, as the database didn't seem to have a clue
what I was on about :)

sarah adams
web developer & programmer
portfolio: http://sarah.designshift.com
blog: http://hardedge.ca

More information about the thelist mailing list