Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I built freetds 0.82 from macports using the +mssql variant (which sets up dblib and sets the default tds version to 8.0). I am now trying to connect to my database server (MSSQL Server 2005) using tsql, but it only works when I override the tds version to 4.2. If I set it to any other value, I get the follow error output.

> TDSVER=8.0 tsql -h <host> -p <port> -U <user> -P<password>
locale is "en_US.utf-8"
locale charset is "utf-8"
Msg 20017, Level 9, State -1, Server OpenClient, Line -1
Unexpected EOF from the server
Msg 20002, Level 9, State -1, Server OpenClient, Line -1
Adaptive Server connection failed
There was a problem connecting to the server

If i use TDSVER=4.2, it works just fine. Anyone know how to solve this?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Found the answer here: http://jonkinney.com/articles/2009/11/23/change-locale-on-os-x-snow-leopard-for-freetds-functionality

The problem was that my locale encoding needed to be set to UTF-8

export LC_ALL=en_US.UTF-8

After that, I was able to connect with version 8.0 of the TDS protocol.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.