Tds.Protocol.Grammar (Tds v2.3.6)

View Source

Grammar Definition for Token Description, General Rules.

Data structure encodings in TDS are defined in terms of the fundamental definitions.

Summary

Functions

A single bit value of either 0 or 1.

An unsigned single byte (8-bit) value.

An unsigned single byte (8-bit) value representing the length of the associated data.

A 2-byte (16-bit) or 4-byte (32-bit) value representing a T-SQL NULL value for a character or binary data type.

An unsigned 4-byte (32-bit) value.

A FRESERVEDBIT is a BIT value used for padding that does not transmit information.

A FRESERVEDBYTE is a BYTE value used for padding that does not transmit information.

A single byte (8-bit) value representing a NULL value.

A signed 4-byte (32-bit) value.

A signed 4-byte (32-bit) value representing the length of the associated data.

A signed 8-byte (64-bit) value.

An unsigned single byte (8-bit) value representing the precision of a numeric number.

An unsigned single byte (8-bit) value representing the scale of a numeric number.

An unsigned single byte (8-bit) value representing a character.

An unsigned 4-byte (32-bit) value.

An unsigned 8-byte (64-bit) value.

An unsigned 8-byte (64-bit) value representing the length of the associated data.

A single Unicode character in UCS-2 encoding, as specified in Unicode.

An unsigned 2-byte (16-bit) value.

An unsigned 2-byte (16-bit) value representing the length of the associated character or binary data.

An unsigned 2-byte (16-bit) value representing the length of the associated data.

Functions

bigbinary(n)

(macro)

bit(n \\ 1)

(macro)

A single bit value of either 0 or 1.

byte(n \\ 1)

(macro)

An unsigned single byte (8-bit) value.

The range is 0 to 255.

bytelen()

(macro)

An unsigned single byte (8-bit) value representing the length of the associated data.

The range is 0 to 255.

charbin_null(n \\ 2)

(macro)

A 2-byte (16-bit) or 4-byte (32-bit) value representing a T-SQL NULL value for a character or binary data type.

Please refer to TYPE_VARBYTE (see section 2.2.5.2.3 in MS-TDS.pdf) for additional details.

dword()

(macro)

An unsigned 4-byte (32-bit) value.

The range when used as a numeric value is 0 to (2^32)- 1.

freservedbit(n \\ 1)

(macro)

A FRESERVEDBIT is a BIT value used for padding that does not transmit information.

FRESERVEDBIT fields SHOULD be set to 0b0 and MUST be ignored on receipt.

freservedbyte(n \\ 1)

(macro)

A FRESERVEDBYTE is a BYTE value used for padding that does not transmit information.

FRESERVEDBYTE fields SHOULD be set to 0x00 and MUST be ignored on receipt.

gen_null()

(macro)

A single byte (8-bit) value representing a NULL value.

long()

(macro)

A signed 4-byte (32-bit) value.

The range is -(2^31) to (2^31)-1.

longlen()

(macro)

A signed 4-byte (32-bit) value representing the length of the associated data.

The range is -(2^31) to (2^31)-1.

longlong()

(macro)

A signed 8-byte (64-bit) value.

The range is –(2^63) to (2^63)-1.

precision()

(macro)

An unsigned single byte (8-bit) value representing the precision of a numeric number.

scale()

(macro)

An unsigned single byte (8-bit) value representing the scale of a numeric number.

uchar(n \\ 1)

(macro)

An unsigned single byte (8-bit) value representing a character.

The range is 0 to 255.

ulong()

(macro)

An unsigned 4-byte (32-bit) value.

The range is 0 to (2^32)-1.

ulonglong()

(macro)

An unsigned 8-byte (64-bit) value.

The range is 0 to (2^64)-1.

ulonglonglen()

(macro)

An unsigned 8-byte (64-bit) value representing the length of the associated data.

The range is 0 to (2^64)-1.

unicodechar(n \\ 1)

(macro)

A single Unicode character in UCS-2 encoding, as specified in Unicode.

ushort()

(macro)

An unsigned 2-byte (16-bit) value.

The range is 0 to 65535.

ushortcharbinlen()

(macro)

An unsigned 2-byte (16-bit) value representing the length of the associated character or binary data.

The range is 0 to 8000.

ushortlen()

(macro)

An unsigned 2-byte (16-bit) value representing the length of the associated data.

The range is 0 to 65535.