Collation Rule Definition

The collation rule is used to specify collation information for character data or metadata describing character data<16>. This is typically specified as part of the LOGIN7 message or part of a column definition in server results containing character data. For more information about column definition, see COLMETADATA.

 LCID             =   20BIT
 fIgnoreCase      =   BIT
 fIgnoreAccent    =   BIT
 fIgnoreWidth     =   BIT
 fIgnoreKana      =   BIT
 fBinary          =   BIT
 fBinary2         =   BIT
 ColFlags         =   fIgnoreCase fIgnoreAccent fIgnoreKana
                      fIgnoreWidth fBinary fBinary2 FRESERVEDBIT
 Version          =   4BIT
 SortId           =   BYTE
 COLLATION        =   LCID ColFlags Version SortId

A SQL (SortId==1) collation is one of a predefined set of sort orders. It is identified by having SortId with values as described by [MSDN-SQLCollation].

For a SortId==0 collation, the LCID bits correspond to a LocaleId as defined by the National Language Support (NLS) functions. For more details, see [MS-LCID].