Slovak_CI_AS collation not recognizing case insensitivity in SQL Server

Sanjoy Jana 21 Reputation points
2022-03-24T11:47:36.097+00:00

Hi All,

Greetings! Hope you all are doing well..

We are facing an issue with the “Slovak_CI_AS” collation and need your inputs. When specified with lowered-case column names, scripts are not recognizing a subset of columns while they are working for others.

Below are quick steps to reproduce the issue. In this case, the SELECT script is failing for a lowered-case “chkey3” column but working fine for “cname”.

  1. Create a new database "CollationTest" with collation "Slovak_CI_AS"
  2. Create a new Table "TestTable" as:

CREATE TABLE [dbo].[TestTable](
[cHKey3] nvarchar NULL,
[cName] nvarchar NULL
) ON [PRIMARY]

  1. Run the below SELECT scripts:

SELECT * FROM TestTable; // runs fine
SELECT cHKey3 FROM TestTable; // runs fine
SELECT cName FROM TestTable; // runs fine
SELECT chkey3 FROM TestTable; // fails with error message "Invalid column name 'chkey3'"
SELECT cname FROM TestTable; // runs fine

  1. Close any open sessions on the database "CollationTest" and alter its collation from "Slovak_CI_AS" to the default "SQL_Latin1_General_CP1_CI_AS"

ALTER DATABASE CollationTest COLLATE SQL_Latin1_General_CP1_CI_AS

  1. Run the scripts in step 3. After altering the collation, all scripts run as expected.

It seems that Slovak_CI_AS is not working correctly for all characters. Appreciate your feedback/suggestion at the earliest.

Thanks,
Sanjoy Jana

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,895 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dan Guzman 9,211 Reputation points
    2022-03-24T12:14:46.857+00:00

    I could be wrong but I believe this is because Ch and ch are the upper and lower case variants of the same single character according to this Slovak orthography. However, cH are 2 separate characters, c and H.