I've got a simple LIKE query on sql server that returns no result when the leading character is the same as the first...
Database tale contains a row with the field 'Lastname' and the value 'Aalesund'
select *
from table
where LastName like 'A%' -- returns no results
if I change the 'Lastname' field to contain 'Alesund' the exact same query returns the correct row.
Any ideas?
Stig
In the Danish/Norwegian collation of Sql server, "aa" is considered a "synonym" for å, Since that was how the letter was written in Denmark before the 1940es. This also means that "aa" is considered the last letter of the alphabet when sorting.
I don't know whether this behavior makes sense in a Norwegian context, but I think the collation is being split in two in Sql server 2012, maybe that will fix it.
UPDATE: According to Wikipedia, the usage of "Aa" as "Å" in Norway is similar to the Danish usage: "Aa" has been abolished by the official organizations standardizing the languages for several decades, but some towns refuse to change their names for historical reasons, and "Aa" is also still common in family names.
Based on this, I would say that failing to find "Aalesund" when doing a search for LIKE "A%" is the most correct behavior in a Norwegian-localized application. If you refrain from using the Danish/Norwegian collation in order to change this, you should be aware that it will change other properties such as sorting of special letters, as mentioned above.
The many different collations named Danish_Norwegian_... will not help you AFAIK. They specify behaviour regarding sensitivity to case, accents, character width, and kana type (the latter is only relevant in Japanese, I believe). "Å" is not considered an accented "A", but a distinct letter. A description of the naming conventions for collations is in this MSDN article.
UPDATE 2: Surprisingly, it seems the collation Norwegian_100_CI_AI does what you want. Maybe the usage in Denmark and Norway is different after all...
That name is sometimes spelled "Ålesund" The little circle over the A is very small in some fonts. You may be inadvertently copy/pasting "Ålesund" when you try the query with the full name. Try
select * from table where LastName like 'Å%'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With