Share via


2.2.3.1.3 Length

Length is the size of the packet including the 8 bytes in the packet header. It is the number of bytes from the start of this header to the start of the next packet header. Length is a 2-byte, unsigned short and is represented in network byte order (big-endian).

The Length value MUST be greater than or equal to 512 bytes and smaller than or equal to 32,767 bytes. The packet size MUST be smaller than or equal to 4,096 bytes until Length is successfully negotiated. The default value is 4,096 bytes.

Starting with TDS 7.3, Length MUST be the negotiated packet size when sending a packet from client to server, unless it is the last packet of a request (that is, the EOM bit in Status is ON) or the client has not logged in.