SQL Server 定序名稱 (Transact-SQL)SQL Server Collation Name (Transact-SQL)

適用於: 是SQL Server 是Azure SQL Database 是Azure Synapse Analytics (SQL DW) 是平行處理資料倉儲 APPLIES TO: yesSQL Server yesAzure SQL Database yesAzure Synapse Analytics (SQL DW) yesParallel Data Warehouse

這是指定 SQL ServerSQL Server 定序之定序名稱的單一字串。Is a single string that specifies the collation name for a SQL ServerSQL Server collation.

SQL ServerSQL Server 支援 Windows 定序。supports Windows collations. SQL ServerSQL Server 也支援有限數目 (<80) 的定序,稱為 SQL ServerSQL Server 定序,這些定序是在 SQL ServerSQL Server 支援 Windows 定序之前開發。also supports a limited number (<80) of collations called SQL ServerSQL Server collations which were developed before SQL ServerSQL Server supported Windows collations. 為了回溯相容性,SQL ServerSQL Server 定序仍然受到支援,但是不應該用於新的開發工作。SQL ServerSQL Server collations are still supported for backward compatibility, but should not be used for new development work. 如需 Windows 定序的詳細資訊,請參閱 Windows 定序名稱For more information about Windows collations, see Windows Collation Name.

主題連結圖示 Transact-SQL 語法慣例Topic link icon Transact-SQL Syntax Conventions

語法Syntax

<SQL_collation_name> :: =
SQL_SortRules[_Pref]_CPCodepage_<ComparisonStyle>

<ComparisonStyle> ::=
_CaseSensitivity_AccentSensitivity | _BIN

引數Arguments

SortRules 用來識別指定字典排序時套用排序規則之字母或語言的字串。SortRules A string identifying the alphabet or language whose sorting rules are applied when dictionary sorting is specified. 例如 Latin1_General 或 Polish。Examples are Latin1_General or Polish.

Pref 指定預設為大寫。Pref Specifies uppercase preference. 即使比較不區分大小寫,但是當沒有其他區分方式時,字母的大寫版本還是會排在小寫版本的前面。Even if comparison is case-insensitive, the uppercase version of a letter sorts before the lowercase version, when there is no other distinction.

Codepage 指定識別定序所用字碼頁的一至四位數。Codepage Specifies a one- to four-digit number that identifies the code page used by the collation. CP1 指定字碼頁 1252;若是其他所有字碼頁,則必須指定完整的字碼頁編號。CP1 specifies code page 1252, for all other code pages the complete code page number is specified. 例如,CP1251 指定字碼頁 1251,而 CP850 則指定字碼頁 850。For example, CP1251 specifies code page 1251 and CP850 specifies code page 850.

CaseSensitivity CI 指定不區分大小寫,CS 指定區分大小寫。CaseSensitivity CI specifies case-insensitive, CS specifies case-sensitive.

AccentSensitivity AI 指定不區分腔調字,AS 指定區分腔調字。AccentSensitivity AI specifies accent-insensitive, AS specifies accent-sensitive.

BIN 指定要使用二進位排序次序。BIN Specifies the binary sort order to be used.

RemarksRemarks

若要列出您的伺服器支援的 SQL ServerSQL Server 定序,請執行下列查詢。To list the SQL ServerSQL Server collations supported by your server, execute the following query.

SELECT * FROM sys.fn_helpcollations()
WHERE name LIKE 'SQL%';

注意

針對排序順序識別碼 80,請使用任何 Window 定序與字碼頁 1250,以及二進位順序。For Sort Order ID 80, use any of the Window collations with the code page of 1250, and binary order. 例如:Albanian_BIN、Croatian_BIN、Czech_BIN、Romanian_BIN、Slovak_BIN、Slovenian_BIN。For example: Albanian_BIN, Croatian_BIN, Czech_BIN, Romanian_BIN, Slovak_BIN, Slovenian_BIN.

另請參閱See Also