-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection to database with valid collation returns "The Collation specified by SQL Server is not supported." (Kazakh_90_CI_AS) #576
Comments
Hi @dineubr , One question, what's the data type of your column where you inserted the 'test' value? |
Hi Karina! Thanks for your help with this. But in order to do other tests using inserts and updates for example, I created a simple table through the following code: Let me know if I can help with anything else :) |
@dineubr Thanks for the information. I am able to reproduce it with both powershell and SSMS. BTW, I tried with sqlcmd which uses ODBC driver and didn't see the exception. And I also checked with other collations such as Uzbek_Latin_90_CI_AS / Thai_100_CI_AS / Persian_100_CI_AS / Korean_90_CI_AS / Kazakh_100_CI_AS and found that only Kazakh has this collation errors. I will get back to you if I find anything behind the scene. |
@dineubr I look more into the driver's code. We get CollationUnsupportedException because the code page we get from This piece of code can be found in When we reach codePage = 0, we won't be able to get its corresponding encoding. The following query you are using will follow the path of how we deal with narrow characters in the driver. This requires valid encoding for the database collation. Otherwise, it will throw CollationUnsupportedException. One workaround for your case is to use wide characters in the query: In this way, the driver will pass the |
@dineubr After more investigation and discussion about this, the 0 code page returned from A temporary fix for this will be created soon. In order to avoid this kind of mismatching code page and collation scenarios in the future, we will need a new design in the driver to fetch the correct code page according to the SQL Server standard. |
Hi @karinazhou. Thanks for the update and the quick reply on the investigation :) |
Description
When we connect to databases that have the collation Kazakh_90_CI_AS and run queries with explicit text on field names (such as "select 'test'") we get the following error:
To reproduce
Here is a powershell script that connects and executes the query:
Expected behavior
It was expected to have one row with 'test' as a result.
Further technical details
dotnet --info:
.NET Framework Version (Registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full): 4.8.03761
System.Data.dll:
The text was updated successfully, but these errors were encountered: