Choosing a TDS protocol version

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

ProductTDS VersionComment
Sybase before System 10, Microsoft SQL Server 6.x4.2Still works with all products, subject to its limitations.
Sybase System 10 and above5.0Still the most current protocol used by Sybase.
Sybase System SQL Anywhere5.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.07.0Includes support for the extended datatypes in SQL Server 7.0 (such as char/varchar fields of more than 255 characters), and support for Unicode.
Microsoft SQL Server 20008.0Include support for bigint (64 bit integers), variant and collation on all fields. variant is not supported; collation is not widely used.

Why downgrade your protocol? If you encounter a bug, reverting to 4.2 can help isolate it. If you're using low-bandwidth connections, 4.2 is faster than 7.0, because 7.0 transfers all character data in UCS-2 (Unicode, 2 bytes/character). However TDS 4.2 has many limitations (see below). If you encounter problems, please report them to the mailing list.

TDS 4.2 has limitations

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.