JezK
Edit File: what.html
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 1. What is FreeTDS?</title><link rel="stylesheet" type="text/css" href="userguide.css" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="home" href="index.html" title="FreeTDS User Guide" /><link rel="up" href="index.html" title="FreeTDS User Guide" /><link rel="prev" href="about.html" title="About this User Guide" /><link rel="next" href="tdshistory.html" title="History of TDS Versions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. What is <span class="productname">FreeTDS</span>?</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="about.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="tdshistory.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="what"></a>Chapter 1. What is <span class="productname">FreeTDS</span>?</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="what.html#tdsprotocolhist">Background: The <acronym class="acronym">TDS</acronym> Protocol and related <acronym class="acronym">API</acronym>s </a></span></dt><dt><span class="sect1"><a href="tdshistory.html">History of <acronym class="acronym">TDS</acronym> Versions</a></span></dt><dt><span class="sect1"><a href="FreeTDShistory.html">History of <span class="productname">FreeTDS</span></a></span></dt><dt><span class="sect1"><a href="projects.html">Current Projects, Language Bindings, and Alternatives</a></span></dt><dd><dl><dt><span class="sect2"><a href="projects.html#Current">Current Projects</a></span></dt><dt><span class="sect2"><a href="projects.html#Status">Status</a></span></dt><dt><span class="sect2"><a href="projects.html#Languages">Languages besides C</a></span></dt><dt><span class="sect2"><a href="projects.html#alternatives">Alternatives</a></span></dt></dl></dd></dl></div><p><span class="productname">FreeTDS</span> is re-implementation of C libraries originally marketed by Sybase and Microsoft SQL Server. It allows many open source applications such as <span class="productname">Perl</span> and <span class="productname">PHP</span> (or your own C or C++ program) to connect to Sybase or Microsoft <span class="productname">SQL Server</span>. </p><p><span class="productname">FreeTDS</span> provides drop-in replacements for </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>Sybase's <code class="systemitem">DB-Library</code> and <code class="systemitem">CT-Library</code></p></li><li class="listitem"><p>Microsoft's <code class="systemitem">DB-Library</code> (which differs in small details from Sybase's)</p></li><li class="listitem"><p>the <code class="systemitem">ODBC</code> drivers from both vendors</p></li><li class="listitem"><p>interactive SQL and BCP utilities</p></li></ul></div><p> The <span class="quote">“<span class="quote">TDS</span>”</span> part of the name comes from name of the protocol used to communicate with such servers: the Tabular Data Stream. </p><p><span class="productname">FreeTDS</span> is distributed in source code form, and is expected to compile on just about any operating system. That means every form of Unix® and Unix-like™ system (including notable variants such as Interix® and QNX®), as well as Win32®, VMS®, and OS X®. If it doesn't compile on your system — and you're not using MS-DOS® — it's probably considered a bug.</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="tdsprotocolhist"></a>Background: The <acronym class="acronym">TDS</acronym> Protocol and related <acronym class="acronym">API</acronym>s </h2></div></div></div><p><acronym class="acronym">TDS</acronym> is a <em class="firstterm">protocol</em>, 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 <span class="quote">“<span class="quote">bits on the wire</span>”</span>, how data flow.</p><p>In reading this manual, it may be helpful to keep in mind that a protocol is not an <acronym class="acronym">API</acronym>, 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. But programmers aren't generally in the business of sending bytes; that's the job of a library. Over the years, there have been a few libraries — each with its own <acronym class="acronym">API</acronym> — that do the work of moving SQL through a <acronym class="acronym">TDS</acronym> pipe. <code class="systemitem">ODBC</code>, <code class="systemitem">DB-Library</code>, and <code class="systemitem">CT-Library</code> have very different <acronym class="acronym">API</acronym>s, but they're all one to the server, because on the wire they speak <acronym class="acronym">TDS</acronym>.</p><p>The <acronym class="acronym">TDS</acronym> protocol was designed and developed by Sybase Inc. for their Sybase <span class="productname">SQL Server</span> 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 <code class="systemitem">DB-Library</code>.</p><p><code class="systemitem">DB-Library</code> provided an <acronym class="acronym">API</acronym> to the client program, and communicated with the server. What it sent to the server took the form of a stream of bytes meant for tables of data, a Tabular Data Stream.</p><p>In 1990 Sybase entered into a technology sharing agreement with Microsoft which resulted in Microsoft marketing its own <span class="productname">SQL Server</span>. Microsoft kept the <code class="systemitem">DB-Library</code> <acronym class="acronym">API</acronym> and added <code class="systemitem">ODBC</code>. (Microsoft has since added other <acronym class="acronym">API</acronym>s, too. It no longer supports its own <code class="systemitem">DB-Library</code> implementation.) At about the same time, Sybase introduced a more powerful <span class="quote">“<span class="quote">successor</span>”</span> to <code class="systemitem">DB-Library</code>, called <code class="systemitem">CT-Library</code>, and called the pair <span class="productname"><em class="firstterm">OpenClient</em></span>.</p><p><code class="systemitem">CT-Library</code>, <code class="systemitem">DB-Library</code>, and <code class="systemitem">ODBC</code> are <acronym class="acronym">API</acronym>s that — however different their programming style may be — all communicate with the server in the same way. The language they use is <acronym class="acronym">TDS</acronym>.</p><p>The <acronym class="acronym">TDS</acronym> protocol comes in several flavors, most of which were not openly documented. If anything, it was considered to be something like a trade secret, or at least proprietary technology. The exception is <acronym class="acronym">TDS</acronym> 5.0, used exclusively by Sybase, for which documentation is available <a class="ulink" href="http://crm.sybase.com/sybase/www/ESD/tds_spec_download.jsp" target="_top">from Sybase</a>.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="about.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="tdshistory.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">About this User Guide </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> History of <acronym class="acronym">TDS</acronym> Versions</td></tr></table></div></body></html>