|FreeTDS User Guide: A Guide to Installing, Configuring, and Running FreeTDS|
|Prev||Chapter 3. Install FreeTDS||Next|
The TDS protocol version is probably something you'd rather not know even existed, much less something you'd have to choose. But there's not that much to it, really. Unless you run into an incompatibility, you're best off running with the highest protocol version supported by your server. That's what the vendors' own products do, which is why when you read the Sybase or Microsoft documentation you find no mention of TDS versions.
Table 3-1. Versions of the TDS Protocol, by Product
|Sybase before System 10, Microsoft SQL Server 6.x||4.2||Still works with all products, subject to its limitations.|
|Sybase System 10 and above||5.0||Still the most current protocol used by Sybase.|
|Sybase System SQL Anywhere||5.0 only||Originally Watcom SQL Server, a completely separate codebase. Our best information is that SQL Anywhere first supported TDS in version 5.5.03 using the OpenServer Gateway (OSG), and native TDS 5.0 support arrived with version 6.0.|
|Microsoft SQL Server 7.0||7.0||Includes support for the extended datatypes in SQL Server 7.0 (such as char/|
|Microsoft SQL Server 2000||7.1||Include support for |
|Microsoft SQL Server 2005||7.2||Includes support for varchar(max), varbinary(max), xml datatypes and MARS[a].|
|Microsoft SQL Server 2008||7.3||Includes support for time, date, datetime2, datetimeoffset.|
|Microsoft SQL Server 2012 or 2014||7.4||Includes support for session recovery.|
|N/A||8.0||FreeTDS will alias this version to 7.1 for backwards compatibility reasons, but this should be avoided due to future compatibility concerns. See note below on obsolete versions.|
a. Multiple Active Result Sets.
For best results, use the highest version of the protocol supported by your server. If you encounter problems, try a lower version. If that works, though, please report it to the mailing list! 
TDS 4.2 has limitations
ASCII only, of course.
RPC is not supported.
BCP is not supported.
varchar fields are limited to 255 characters. If your table defines longer fields, they'll be truncated.
dynamic queries (also called prepared statements) are not supported.
The protocol version may also affect how database servers interpret commands. For example, Microsoft SQL Server 2000 is known to behave differently with versions 4.2 and 7.0. Version 7.0 is recommended for compatibility with SQL Server tools.
In the earlier days of FreeTDS, Microsoft did not release official specs for the TDS protocol. When MSSQL 2000 (product 8.0) was released, there was semi-official indications from the Microsoft community that the TDS protocol would be version 8.0. So the FreeTDS developers adopted that version for FreeTDS. Years later, when Microsoft started releasing official specs of the protocol, it became obvious that the TDS versions that FreeTDS had labeled 8.0 and 9.0 were actually versions 7.1 and 7.2 respectively.
For compatibility reasons version 8.0 is still handled by FreeTDS but you should avoid using it as it could be removed in a future version of FreeTDS or it could clash with a future SQL server version.
Want to help? Try out the auto-protocol feature. FreeTDS has experimental support for iteratively trying protocol connections until it finds one the server accepts. This is suitable when query responses are non-trivial (because the tiny delay in connecting is thus insignificant). Try setting your TDS version to 0 and report your results.