patternMinor
Querying special characters
Viewed 0 times
charactersspecialquerying
Problem
I work with language with special characters (example: e -> é). I have a query with a
The above returns no results when the database contains "dés". Is there a way to have this query return the desired results.
LIKE but when I search a word with special char and my query doesn't have the special char, I don't get the results I expect:select * from a where name like '%e%'The above returns no results when the database contains "dés". Is there a way to have this query return the desired results.
Solution
If the collation of your database is set to accent insensitive, then this should work (for most accented characters).
For example in the collation Latin1_General_CI_AS, the CS means Case Insensitive, Accent Sensitive. You would want the collation to be Latin1_General_CI_AI which means Case Insensitive, Accent Insensitive
Be warned though, that not all "accented" characters are created equally, but for spanish and french searches I found things work out as expected.
For example in the collation Latin1_General_CI_AS, the CS means Case Insensitive, Accent Sensitive. You would want the collation to be Latin1_General_CI_AI which means Case Insensitive, Accent Insensitive
Be warned though, that not all "accented" characters are created equally, but for spanish and french searches I found things work out as expected.
Context
StackExchange Database Administrators Q#8326, answer score: 3
Revisions (0)
No revisions yet.