[thelist] accent insensitive queries in sql server
Sarah Adams
mr.sanders at geekjock.ca
Fri May 4 07:39:23 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". Unfortunately my Google skills failed me
when trying to figure out how work around this issue.
(I suppose I could put a bunch of REPLACEs around the author field in
the where clause, but surely there must be a more efficient and elegant
way. Pleeeeaaase! Tell me there is!)
--
sarah adams
web developer & programmer
portfolio: http://sarah.designshift.com
blog: http://hardedge.ca
More information about the thelist
mailing list