Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search SQL Server for accent insensitive

Status
Not open for further replies.

mabho

Programmer
Aug 28, 2006
11
BR
Hi. I want to query my database with a string and I want SQL Server to see common letters and letters with accents as the same thing. I need it to see "análise" and "analise" as the same thing so that when I query "análise" in the text box, all results are returned, including "análise" and "analise". When I perform that search, SQL Server sees words with accent as different from non'accent words.

My database collation is already set to Latin1_General_CI_AS - Latin1-General, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive

The procedure that gets records from the database uses 'LIKE' to get the results: ... WHERE FIELD1 LIKE '%'+ @SearchString + '%'. Is that such a bad practice?

I am asking people from my Host to enable full-text search for that table. Can Full-text search help me solve the accent issue?

Thanks a lot!
 
It's been awhile since I've done anything like this but you could try the following:

WHERE FIELD1 LIKE '%'+ @SearchString + '%' OR
FIELD1 LIKE '%'+ @SearchString + '%' COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS

The first LIKE will find "analise" and the second LIKE should find "análise"

Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top