Share via


2.2.5.3 Packet Data Stream Headers - ALL_HEADERS Rule Definition

Message streams can be preceded by a variable number of headers as specified by the ALL_HEADERS rule. The ALL_HEADERS rule, Query Notifications (section 2.2.5.3.1), and Transaction Descriptor (section 2.2.5.3.2) were introduced in TDS 7.2. Trace Activity (section 2.2.5.3.3) was introduced in TDS 7.4.

The list of headers that are applicable to the different types of messages are described in the following table.

Stream headers MUST be present only in the first packet of requests that span more than one packet. The ALL_HEADERS rule applies only to the three client request types defined in the table below and MUST NOT be included for other request types. For the applicable request types, each header MUST appear at most once in the stream or packet's ALL_HEADERS field.

Header

Value

SQLBatch

RPCRequest

TransactionManagerRequest

Query Notifications

0x00 01

Optional

Optional

Disallowed

Transaction Descriptor

0x00 02

Required

Required

Required

Trace Activity

0x00 03

Optional

Optional

Optional

Stream-Specific Rules:

 TotalLength      =   DWORD    ;including itself
 HeaderLength     =   DWORD    ;including itself
 HeaderType       =   USHORT;
 HeaderData       =   *BYTE
 Header           =   HeaderLength HeaderType HeaderData

Stream Definition:

 ALL_HEADERS      =   TotalLength 1*Header

Parameter

Description

TotalLength

Total length of ALL_HEADERS stream.

HeaderLength

Total length of an individual header.

HeaderType

The type of header, as defined by the value field in the preceding table.

HeaderData

The data stream for the header. See header definitions in the following subsections.

Header

A structure containing a single header.