Skip to content

"The Collation specified by SQL Server is not supported." for Georgian_Modern_Sort_CI_AS collation  #2182

@cleng-ms

Description

@cleng-ms

Describe the bug

When a database's collation is set to Georgian_Modern_Sort_CI_AS collation, and it has a table that contains a varchar() column, then querying that table in SSMS fails with the following error.
Msg 0, Level 11, State 0, Line 0
The Collation specified by SQL Server is not supported.

This problem can be reproduced on SSMS 19 and SSMS 18 with SQL2019 and SQL2017. It is a 100% repro.

Exception message:
Msg 0, Level 11, State 0, Line 0
The Collation specified by SQL Server is not supported.

To reproduce

With SSMS 19.1

  1. Right click on Database, and then click "New Database..."
  2. In the "New Database" window, set Database name to Coltest1.
    Select the Options page, and change Collation from Default to Georgian_Modern_Sort_CI_AS
    Click OK to create the database.
  3. Right click on the newly created database "Coltest1", and then "New Query".
  4. Copy the following query text and paste into the query window.

create table t (v varchar(20))
go
insert t
values ('abcd')
go
select * from t

  1. execute the query.
    You should see the following error.
    Msg 0, Level 11, State 0, Line 5
    The Collation specified by SQL Server is not supported.

But this does not seem to be an issue specific to SSMS. You can repro with pretty much any .Net application.

 using System;
using System.Data.SqlClient;
 
class C
{
    static void Main()
    {
        // Pick your server here...
        var connStr = new SqlConnectionStringBuilder()
        {
            DataSource = "VLM00230243",
            IntegratedSecurity = true,
            Pooling = false
        };
 
        // Make up a new DB name...
        var db = Guid.NewGuid().ToString();
 
        var sqlconn = new SqlConnection(connStr.ConnectionString);
        sqlconn.Open();
 
        // Create DB with interesting collation... (it's key for the repro)
        var sqlcmd = new SqlCommand($"CREATE DATABASE [{db}] COLLATE Georgian_Modern_Sort_CI_AS", sqlconn);
        sqlcmd.ExecuteScalar();
        sqlconn.Close();
 
        connStr.InitialCatalog = db;
 
        sqlconn = new SqlConnection(connStr.ConnectionString);
        sqlconn.Open();
 
        // Create table (using VARCHAR is also critical for the repro; NVARCHAR works just fine)
        sqlcmd = new SqlCommand("CREATE TABLE T1(C1 varchar(16) NOT NULL)", sqlconn);
        sqlcmd.ExecuteScalar();
        sqlcmd = new SqlCommand("INSERT T1 values('abcd')", sqlconn);
        sqlcmd.ExecuteScalar();
        sqlconn.Close();
 
        sqlconn = new SqlConnection(connStr.ConnectionString);
        sqlconn.Open();
        sqlcmd = new SqlCommand("SELECT * FROM T1", sqlconn);
 
        // If you get an exception at the next line, you've got a repro
        var o = sqlcmd.ExecuteScalar();
        Console.WriteLine(o);
    }
}

Expected behavior

The query succeeds.

Further technical details

Microsoft.Data.SqlClient version: 3.1.3
.NET target: Framework 4.8.04161
SQL Server version: SQL Server 2019
Operating system: Windows Server 2022

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions