HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Problem with Czech collation Czech_CI_AI in MS SQL Server 2008 R2

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
problem2008withsqlcollationserverczechczech_ci_ai

Problem

I have the following issue with accent insensitive search in Czech language. My database is set to Czech_CI_AI collation. For some diacritics system works correctly (ie. I), but for some does not (ie. R). In my database there are several 'DVORA*' records:

SELECT contact_name 
FROM   CONTCTSM1 
WHERE  CONTACT_NAME LIKE 'DVO%'


Results:


DVOŘÁČKOVÁ,

IVETA DVOŘÁČKOVÁ,

JIŘINA DVOŘÁK

Solution

R and Ř are different letters, as opposed to modified base letters(?) like German umlauts with ö vs o

From Czech language on Wikipedia (my bold)


The acute accent (čárka) letters (Á, É, Í, Ó, Ú, Ý) and the kroužek letter Ů all indicate long vowels. They have the same alphabetical ordering as their non-diacritic counterparts. ...The háček (ˇ) indicates historical palatalization of the base letter. The letters Č, Ř, Š, and Ž currently represent postalveolar consonants and are ordered behind their corresponding base letters; while Ď, Ň, Ť represent palatal consonants and have the same alphabetical ordering as their non-diacritic counterparts.

A test with Ö and O in Swedish (different letters) and German (modified)

SELECT 'Finnish_Swedish_100_CI_AI' 
          WHERE N'Ö' COLLATE Finnish_Swedish_100_CI_AI = N'O'
UNION ALL
SELECT 'Latin1_General_CI_AI' 
          WHERE N'Ö' COLLATE Latin1_General_CI_AI = N'O'

Code Snippets

SELECT 'Finnish_Swedish_100_CI_AI' 
          WHERE N'Ö' COLLATE Finnish_Swedish_100_CI_AI = N'O'
UNION ALL
SELECT 'Latin1_General_CI_AI' 
          WHERE N'Ö' COLLATE Latin1_General_CI_AI = N'O'

Context

StackExchange Database Administrators Q#12438, answer score: 6

Revisions (0)

No revisions yet.