2.2.5.4.4 Partially Length-Prefixed Data Types

The data value corresponding to the set of data types defined in this section follows the rule defined in the partially length-prefixed stream definition (section 2.2.5.2.3).

 PARTLENTYPE      =   XMLTYPE
                      /
                      BIGVARCHARTYPE
                      /
                      BIGVARBINARYTYPE
                      /
                      NVARCHARTYPE
                      /
                      UDTTYPE

BIGVARCHARTYPE, BIGVARBINARYTYPE, and NVARCHARTYPE can represent two types each:

  • The regular type with a known maximum size range defined by USHORTLEN_TYPE. For BIGVARCHARTYPE and BIGVARBINARYTYPE, the range is 0 to 8000. For NVARCHARTYPE, the range is 0 to 4000.

  • A type with unlimited max size, known as varchar(max), varbinary(max) and nvarchar(max), which has a max size of 0xFFFF, defined by PARTLENTYPE. This class of types was introduced in TDS 7.2.