Skip to Content.
Sympa Menu

freetds - More guesses about TDS protocol

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Craig Spannring <cts AT internetcds.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: More guesses about TDS protocol
  • Date: Fri, 11 Sep 1998 00:56:29 -0700 (PDT)



I only have access to MS SQLServer (TDS version 4.2) so my comments
might be incorrect for TDS 5.0.

Note- This message contains long lines and won't be displayed properly
in some email clients.

Some of this information was gleaned from version 0.3 of the
tds library but since it hasn't made it onto the web page yet I
thought I'd save Brian Burns some typing and just let him cut and
paste this into the web page.

In the packet header the first byte (the packet type) is
packet type-
0x01 a query from client
0x02 a login packet from client
0x03 a stored procedure invocation from client
0x04 a reply from the server
0x06 a request from client to cancel pending query


In the responses coming back from the server-


Message and error packets (0xAA and 0xAB)


2 bytes 2 bytes 1 byte 1 byte 2 bytes variable 1 byte
variable 1 byte variable 1 byte

+------------+--------+-------+-------+--------+----------+---------+----------+----------+----------+--------+
| packet | msg | msg | msg | msg | msg | server |
server | procname | procname | msg |
| length | number | state | level | text | text | name | name
| length | | line |
| (redundant)| | | | length | | length |
| | | number |

+------------+--------+-------+-------+--------+----------+---------+----------+----------+----------+--------+





End of results packets (0xFD, 0xFE, and 0xFF)

1 byte 3 bytes 4 bytes
+--------+---------+--------------+
| status | unknown | # of rows |
| byte | | in resultset |
+--------+---------+--------------+

The status byte seems to be an or'ing of bit flags.

bit flag
------+------------------------
0x01 | More resuls sets follow
0x20 | The query was canceled





--
=======================================================================
Life is short. | Craig Spannring
Ski hard, Bike fast. | cts AT internetcds.com
--------------------------------+------------------------------------
Any sufficiently perverted technology is indistinguishable from Perl.
=======================================================================



  • More guesses about TDS protocol, Craig Spannring, 09/10/1998

Archive powered by MHonArc 2.6.24.

Top of Page