Tabular Data Stream (TDS) is a protocol, or a set of rules describing how to transmit data between two computers. Like any protocol, it defines the types of messages that can be sent, and the order in which they may be sent. Protocols describe the "bits on the wire", specifying how data flows. It confuses many but entrances a few.

A protocol is not an API, although the two are related. The server recognizes and speaks a protocol; anything that can send it the correct combination of bytes in the right order can communicate with it. Typically this task is handled by a software library. Over the years, there have been a few libraries — each with its own API — that do the work of moving SQL through a TDS pipe. ODBC, db-lib, ct-lib, and JDBC have very different APIs, but they're all one to the server, because on the wire they speak TDS.

The TDS protocol was designed and developed by Sybase Inc. for their Sybase SQL Server relational database engine in 1984. The problem Sybase faced then still exists: There was no commonly accepted application-level protocol to transfer data between a database server and its client. To encourage the use of their product, Sybase came up with a flexible pair of libraries called netlib, and db-lib.

netlib's job was to ferry data between the two computers. To do that, it had to deal with the underlying network protocol. In those days TCP/IP was not the ubiquitous thing it is today. Besides TCP/IP, netlib ran on DECnet, IPX/SPX, NetBEUI and the like.

db-lib provided an API to the client program, and communicated with the server via netlib. What db-lib sent to the server took the form of a stream of bytes, a structured stream of bytes meant for tables of data, a Tabular Data Stream.

In 1990, Sybase entered into a technology sharing agreement with Microsoft which resulted in Microsoft marketing its own SQL Server — Microsoft SQL Server — based on the Sybase code. Microsoft kept the db-lib API and added ODBC. (Microsoft has since added other APIs, too.) At about the same time, Sybase introduced a more powerful "successor" to db-lib, called ct-lib, and called the pair Open Client.

ct-lib, db-lib, and ODBC are APIs that -- however different their programming style may be -- all use netlib to communicate to the server. The language they use is TDS.

The TDS protocol comes in several varieties, most of which have never been openly documented because they are considered to be proprietary technology. The exception is TDS 5.0, used exclusively by Sybase, for which documentation is available from Sybase.

A free implementation of the TDS protocol has been developed by the FreeTDS team, this software is licensed under the GPL license.

Protocols/tds (last edited 2008-04-12 17:51:24 by localhost)