FreeTDS User Guide: A Guide to Installing, Configuring, and Running FreeTDS
Prev |  | Next

# Chapter 5. Advanced Configurations

This chapter details some advanced configurations that need expanded explanation.

# Big Endian Clients with Buggy SQL Servers

Several version of Microsoft SQL server have a bug that affects big endian clients. This includes 7.0 GA and 7.0 SP1. Furthermore, TDS Protocol version 7.0 is natively little endian. SQL Server 2000 is also reported not to work from big endian clients without little endian emulation turned on.

If you are unfamiliar with the terms big endian and little endian, they are terms that come originally from Gullivers Travels. What they refer to in computer science is the the order in which bytes are stored by a processor. Big endian machines such as Sparc and PowerPC store the most significant byte in the first memory location of a multi-byte integer. Little endian machines such as Intel and Alpha do it the other way around. So the 16-bit number 258 would be 0x0102 on big endian and 0x0201 on little endian machines.

In this example we want to force connections to a server named `mssql` to emulate a little endian client. We are using protocol version 4.2 here, version 7.0 and 8.0 will automatically emulate little endian mode regardless of the `freetds.conf` setting. You shouldn't use this option, set another protocol version instead (7.0 or 8.0).

Example 5-1. Emulate Little Endian `freetds.conf` setting

    [mssql]
    	host = ntbox.mydomain.com
    	port = 1433
    	tds version = 4.2
    	emulate little endian = yes

Prev | Home | Next
Troubleshooting ODBC connections |  | TDS 7.0 for Nonwestern Languages