TDS ALTFMT
TDS_ALTFMT
This is the data stream token that indicates that this is a data
stream containing a description of compute data. This token is one byte.
Value 0xA8
- TDS_ALTFMT
- Length
- ID
- #OPS
- OPType
- OPCol#
- User Type
- DataType
- Length
- LocaleLen
- Locale Info
- Length: This length specifies the number of bytes remaining in the data stream. It is an unsigned, two-byte integer.
- ID: This is the id which identifies the compute statement to which the compute column formats apply. Because a Transact-SQL statement may have more than one compute clause, the id is necessary. The id is used later in order to correctly interpret the compute row data which comes in the TDS_ALTROW data stream. Id is a two-byte, unsigned integer.
- #OPS: This is the number of aggregate operators in the compute clause. For example, the clause “compute count(x), min(x), max(x)” has three aggregate operators. This field is a one-byte, unsigned integer.
- OPType: This is the type of aggregate operator. The operands for the aggregate are described by the # ByCols and Col # fields. The possible operators are:
| Operator Name | Operator Value | Description |
|---|---|---|
| TDSALT_AVG | $4F | The average value |
- OPCol#: This is the column number associated with OpType. The first column in the select list is 1. This argument is a one-byte, unsigned integer.
See Also TDS_ALTNAME, TDS_ALTROW