SQL Flow Field Guide

Collation - TERTIARY_WEIGHTS

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

collation metadata lookup

What changes

Input
collation name and property
Output or change
property value
Return type
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) da

Syntax at a glance

TERTIARY_WEIGHTS( non_Unicode_character_string_expression )

Work example

Read tertiary sort weights for a collation-specific comparison workflow.

Use the result only with the matching collation and treat the bytes as sort metadata.

Check your work Sort weights are collation dependent and are not a portable text key.

Open Microsoft Learn for full syntax, permissions, and details for your version.