简体   繁体   English

SQL Server:选择排序规则

[英]SQL Server: Choosing a collation

I have an SQL Server database and I'm trying to choose the appropriate collation.我有一个 SQL Server 数据库,我正在尝试选择适当的排序规则。

Right now, the default one is selected: SQL_Latin1_General_CP1_CI_AS.现在,选择了默认值:SQL_Latin1_General_CP1_CI_AS。 However, this is not enough - I need to include both latin (including Č, Ć, Š...) and cyrillic characters (Ш, Ж...).但是,这还不够 - 我需要同时包含拉丁文(包括 Č、Ć、Š...)和西里尔字符(Ш、Ж...)。 Is there a character set that encompases all of these, or better, a way to enable UTF8 as collation?是否有包含所有这些的字符集,或者更好的方法来启用 UTF8 作为排序规则?

You're using the SQL collations.您正在使用 SQL 排序规则。 UTF-8 is supported under the windows collations. Windows 排序规则支持 UTF-8。

Ie in your example SQL_Latin1_General_CP1_CI_AS is a SQL collation, with Latin1_General_100_CI_AS being compareable.即在您的示例中 SQL_Latin1_General_CP1_CI_AS 是 SQL 排序规则,Latin1_General_100_CI_AS 是可比较的。 But if you look at these set of collations.但是,如果您查看这些排序规则。 There's also ones with UTF8.还有一些带有UTF8的。

For example, there's Latin1_General_100_CI_AS_KS_WS_SC_UTF8例如,有 Latin1_General_100_CI_AS_KS_WS_SC_UTF8

Which is:这是:

  • Case Insensitive不区分大小写
  • Accent Sensitive口音敏感
  • Kana Sensitive假名敏感
  • Width Sensitive宽度敏感
  • Supplementary Character support补充字符支持
  • Has UTF8 support有 UTF8 支持

UTF8 is not present in SQL only collations. UTF8 不存在于仅 SQL 的排序规则中。 And depending on your actual Server instance version, might not be available either.根据您的实际服务器实例版本,也可能不可用。

Msdn links: msdn链接:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM