照合順序関数 - TERTIARY_WEIGHTS (Transact-SQL)Collation Functions - TERTIARY_WEIGHTS (Transact-SQL)
適用対象:Applies to: SQL ServerSQL Server (サポートされているすべてのバージョン)
SQL ServerSQL Server (all supported versions)
Azure SQL データベースAzure SQL Database
Azure SQL データベースAzure SQL Database
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure Synapse AnalyticsAzure Synapse Analytics
Azure Synapse AnalyticsAzure Synapse Analytics
Parallel Data WarehouseParallel Data Warehouse
Parallel Data WarehouseParallel Data Warehouse
SQL ServerSQL Server (サポートされているすべてのバージョン)
SQL ServerSQL Server (all supported versions)
Azure SQL データベースAzure SQL Database
Azure SQL データベースAzure SQL Database
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure Synapse AnalyticsAzure Synapse Analytics
Azure Synapse AnalyticsAzure Synapse Analytics
Parallel Data WarehouseParallel Data Warehouse
Parallel Data WarehouseParallel Data Warehouse
この関数は、第 3 の SQL 照合順序で定義された、Unicode 以外の文字列式内の文字ごとに、バイナリ文字列の重みを返します。For each character in a non-Unicode string expression - defined with a SQL tertiary collation - this function returns a binary string of weights.
Transact-SQL 構文表記規則
Transact-SQL Syntax Conventions
構文Syntax
TERTIARY_WEIGHTS( non_Unicode_character_string_expression )
注意
SQL Server 2014 以前の Transact-SQL 構文を確認するには、以前のバージョンのドキュメントを参照してください。To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation.
引数Arguments
non_Unicode_character_string_expressionnon_Unicode_character_string_expression
第 3 の SQL 照合順序で定義される char、varchar、または varchar(max) 型の文字列 式 です。A string expression of type char, varchar, or varchar(max) defined on a tertiary SQL collation. これらの照合順序の一覧については、「解説」を参照してください。For a list of these collations, see Remarks.
戻り値の型Return types
TERTIARY_WEIGHTS
は、non_Unicode_character_string_expression が char または varchar であるときに varbinary を返し、non_Unicode_character_string_expression に varchar(max) データ型が含まれるときには varbinary(max) を返します。TERTIARY_WEIGHTS
returns varbinary when non_Unicode_character_string_expression is char or varchar, and it returns varbinary(max) when the non_Unicode_character_string_expression has a varchar(max) data type.
解説Remarks
第 3 の SQL 照合順序で non_Unicode_character_string_expression が定義されていない場合、TERTIARY_WEIGHTS
は NULL を返します。TERTIARY_WEIGHTS
returns NULL when a SQL tertiary collection does not define the non_Unicode_character_string_expression. 次の表に、第 3 の SQL 照合順序を示します。This table shows the SQL tertiary collations:
並べ替え順 IDSort order ID | SQL 照合順序SQL collation |
---|---|
3333 | SQL_Latin1_General_Pref_CP437_CI_ASSQL_Latin1_General_Pref_CP437_CI_AS |
3434 | SQL_Latin1_General_CP437_CI_AISQL_Latin1_General_CP437_CI_AI |
4343 | SQL_Latin1_General_Pref_CP850_CI_ASSQL_Latin1_General_Pref_CP850_CI_AS |
4444 | SQL_Latin1_General_CP850_CI_AISQL_Latin1_General_CP850_CI_AI |
4949 | SQL_1xCompat_CP850_CI_ASSQL_1xCompat_CP850_CI_AS |
5353 | SQL_Latin1_General_Pref_CP1_CI_ASSQL_Latin1_General_Pref_CP1_CI_AS |
5454 | SQL_Latin1_General_CP1_CI_AISQL_Latin1_General_CP1_CI_AI |
5656 | SQL_AltDiction_Pref_CP850_CI_ASSQL_AltDiction_Pref_CP850_CI_AS |
5757 | SQL_AltDiction_CP850_CI_AISQL_AltDiction_CP850_CI_AI |
5858 | SQL_Scandinavian_Pref_CP850_CI_ASSQL_Scandinavian_Pref_CP850_CI_AS |
8282 | SQL_Latin1_General_CP1250_CI_ASSQL_Latin1_General_CP1250_CI_AS |
8484 | SQL_Czech_CP1250_CI_ASSQL_Czech_CP1250_CI_AS |
8686 | SQL_Hungarian_CP1250_CI_ASSQL_Hungarian_CP1250_CI_AS |
8888 | SQL_Polish_CP1250_CI_ASSQL_Polish_CP1250_CI_AS |
9090 | SQL_Romanian_CP1250_CI_ASSQL_Romanian_CP1250_CI_AS |
9292 | SQL_Croatian_CP1250_CI_ASSQL_Croatian_CP1250_CI_AS |
9494 | SQL_Slovak_CP1250_CI_ASSQL_Slovak_CP1250_CI_AS |
9696 | SQL_Slovenian_CP1250_CI_ASSQL_Slovenian_CP1250_CI_AS |
106106 | SQL_Latin1_General_CP1251_CI_ASSQL_Latin1_General_CP1251_CI_AS |
108108 | SQL_Ukrainian_CP1251_CI_ASSQL_Ukrainian_CP1251_CI_AS |
113113 | SQL_Latin1_General_CP1253_CS_ASSQL_Latin1_General_CP1253_CS_AS |
114114 | SQL_Latin1_General_CP1253_CI_ASSQL_Latin1_General_CP1253_CI_AS |
130130 | SQL_Latin1_General_CP1254_CI_ASSQL_Latin1_General_CP1254_CI_AS |
146146 | SQL_Latin1_General_CP1256_CI_ASSQL_Latin1_General_CP1256_CI_AS |
154154 | SQL_Latin1_General_CP1257_CI_ASSQL_Latin1_General_CP1257_CI_AS |
156156 | SQL_Estonian_CP1257_CI_ASSQL_Estonian_CP1257_CI_AS |
158158 | SQL_Latvian_CP1257_CI_ASSQL_Latvian_CP1257_CI_AS |
160160 | SQL_Lithuanian_CP1257_CI_ASSQL_Lithuanian_CP1257_CI_AS |
183183 | SQL_Danish_Pref_CP1_CI_ASSQL_Danish_Pref_CP1_CI_AS |
184184 | SQL_SwedishPhone_Pref_CP1_CI_ASSQL_SwedishPhone_Pref_CP1_CI_AS |
185185 | SQL_SwedishStd_Pref_CP1_CI_ASSQL_SwedishStd_Pref_CP1_CI_AS |
186186 | SQL_Icelandic_Pref_CP1_CI_ASSQL_Icelandic_Pref_CP1_CI_AS |
char、varchar、または varchar (max) 列の値で定義されている計算列の定義に対して TERTIARY_WEIGHTS
を使用します。Use TERTIARY_WEIGHTS
for the definition of a computed column defined on the values of a char, varchar, or varchar(max) column. クエリの ORDER BY 句で char、varchar、または varchar(max) 列を指定する場合は、計算列と、char、varchar、または varchar(max) 列の両方に対するインデックス定義によって、パフォーマンスを向上させることができます。Index definition on both the computed column and the char, varchar, or varchar(max) column can improve performance when the ORDER BY clause of a query specifies that char, varchar, or varchar(max) column.
例Examples
この例では、TERTIARY_WEIGHTS
関数を char
列の値に適用するテーブルに計算列を作成します。This example creates a computed column in a table that applies the TERTIARY_WEIGHTS
function to the values of a char
column:
CREATE TABLE TertColTable
(Col1 char(15) COLLATE SQL_Latin1_General_Pref_CP437_CI_AS,
Col2 AS TERTIARY_WEIGHTS(Col1));
GO