FreeTDS is re-implementation of C libraries originally marketed by Sybase and Microsoft SQL Server. It allows many open source applications such as Perl and PHP (or your own C or C++ program) to connect to Sybase or Microsoft SQL Server.

FreeTDS provides drop-in replacements for

  • Sybase's DB-Library and CT-Library

  • Microsoft's DB-Library (which differs in small details from Sybase's)

  • the ODBC drivers from both vendors

  • interactive SQL and BCP utilities

The "TDS" part of the name comes from name of the protocol used to communicate with such servers: the Tabular Data Stream.

FreeTDS 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.

Background: The TDS Protocol and related APIs

TDS is a protocol, 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", how data flow.

In reading this manual, it may be helpful to keep in mind that 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. 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 API — that do the work of moving SQL through a TDS pipe. ODBC, DB-Library, and CT-Library 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 DB-Library.

DB-Library provided an API 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.

In 1990 Sybase entered into a technology sharing agreement with Microsoft which resulted in Microsoft marketing its own SQL Server. Microsoft kept the DB-Library API and added ODBC. (Microsoft has since added other APIs, too. It no longer supports its own DB-Library implementation.) At about the same time, Sybase introduced a more powerful "successor" to DB-Library, called CT-Library, and called the pair OpenClient.

CT-Library, DB-Library, and ODBC are APIs that — however different their programming style may be — all communicate with the server in the same way. The language they use is TDS.

The TDS 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 TDS 5.0, used exclusively by Sybase, for which documentation is available from Sybase.

http://www.freetds.org/userguide/what.htm的更多相关文章

  1. linux使用freetds 连接连远程服务器sqlservser2012

    1.下载:freetds-patched.tar.gz  http://www.freetds.org/software.html http://www.freetds.org/userguide/c ...

  2. CentOS 6.8 LAMP 安装配置

    1.远程系统拒绝了连接: 需要关闭防火墙/etc/rc.d/init.d/iptables stop service iptables stop chkconfig iptables off sete ...

  3. ubuntu系统下配置php支持SQLServer数据库

    最近在做一个项目,该项目的数据库是微软公司的的SQLserver ,数据库安装在另一台windows服务器上,而项目却部署在ubuntu server上.那么这样就会涉及到项目在linux上如何链接S ...

  4. 一次php访问sql server 2008的API接口的采坑

    2018年6月21日17:17:09,注意:不是详细文档,新手可能会看不懂 windows下安装 项目是sql server 2008的k3,php连接数据库写的API,因为是买的时候是别人的程序,测 ...

  5. ubuntu php 连接sql server

    1.下载最新的freetds ,访问 http://www.freetds.org/, 或者在 ubuntu上用 wget ftp://ftp.freetds.org/pub/freetds/stab ...

  6. Ubuntu系统下配置PHP支持SQLServer 2005

    最近在做一个项目,该项目的数据库是微软公司的的SQLserver ,数据库安装在另一台windows服务器上,而项目却部署在ubuntu server上.那么这样就会涉及到项目在linux上如何链接S ...

  7. pymssql.connect(server='.', user='', password='', database='', timeout=0, login_timeout=60, charset='UTF-8', as_dict=False, host='', appname=None, port='1433', conn_properties, autocommit=False, tds_

    http://pymssql.org/en/stable/ref/pymssql.html """ This is an effort to convert the py ...

  8. 在MacOS下使用sqlalchemy 连接sqlserver2012 数据库

    在MacOS下使用sqlalchemy 连接sqlserver 数据库 前言 最近有要求,要将数据库换成巨硬家的sqlserver 2012 因为在网上苦苦找不到sqlalchemy 配置连接SqlS ...

  9. linux lazarus 连接mssqlserver

    1 . 从https://www.freetds.org/ 下载驱动源文件 2. 参照 https://www.freetds.org/userguide/config.htm 内容编译 3. 启动l ...

随机推荐

  1. 用cpp写对拍程序

    #include <bits/stdc++.h> using namespace std; int main() { while(true) { puts(""); p ...

  2. BZOJ 3926: [Zjoi20150]诸神眷顾的幻想乡

    3926: [Zjoi20150]诸神眷顾的幻想乡 Time Limit: 10 Sec  Memory Limit: 512 MBSubmit: 438  Solved: 273 Descripti ...

  3. zoj 2736 Daffodil number

    Daffodil number Time Limit: 2 Seconds      Memory Limit: 65536 KB The daffodil number is one of the ...

  4. [luoguP2184] 贪婪大陆(树状数组)

    传送门 用两个树状数组,cr 维护 1....x 中 r 的数量 cl 维护 1....x 中 l 的数量 求答案的时候只需要求 y 前面 被作为左端点 的个数 - x 前面 被作为右端点的个数 —— ...

  5. 【Dijstra堆优化】HDU 3986 Harry Potter and the Final Battle

    http://acm.hdu.edu.cn/showproblem.php?pid=3986 [题意] 给定一个有重边的无向图,T=20,n<=1000,m<=5000 删去一条边,使得1 ...

  6. hdu 4710

    #include<stdio.h> #include<math.h> __int64 min(__int64 a,__int64 b) { return a<b?a:b; ...

  7. [NOIP1999] 提高组 洛谷P1014 Cantor表

    题目描述 现代数学的著名证明之一是Georg Cantor证明了有理数是可枚举的.他是用下面这一张表来证明这一命题的: 1/1 1/2 1/3 1/4 1/5 … 2/1 2/2 2/3 2/4 … ...

  8. BZOJ 4894 有向图 外向生成树个数

    4894: 天赋 Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 191  Solved: 150[Submit][Status][Discuss] D ...

  9. 牛客网暑期ACM多校训练营(第六场)G

    https://www.nowcoder.com/acm/contest/144/G 链接:https://www.nowcoder.com/acm/contest/144/G来源:牛客网 In Vi ...

  10. T1992 聚会 codevs

    http://codevs.cn/problem/1992/  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 黄金 Gold 题目描述 Description 小S 想要从某地 ...