Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jdavidb (1361)

jdavidb
  (email not shown publicly)
http://voiceofjohn.blogspot.com/

J. David Blackstone has a Bachelor of Science in Computer Science and Engineering and nine years of experience at a wireless telecommunications company, where he learned Perl and never looked back. J. David has an advantage in that he works really hard, he has a passion for writing good software, and he knows many of the world's best Perl programmers.

Journal of jdavidb (1361)

Tuesday August 05, 2008
02:03 PM

MSSQL SQLServer FreeTDS Unicode collation error

[ #37102 ]

I'm using DBD::Sybase over FreeTDS to access an MS SQLServer database and getting the following commonly-encountered error:

Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier.

This error is all over the net, seen by poor souls using Python, Borland tools, and I don't know what all else. Sadly, most of them appear to have not found a solution, other than "change the type of your column." That solution isn't available to me (if it were, I would be changing the type of my database!), so I had to keep digging until I found the real solution:

Set tds version = 8.0 in your freetds.conf file. (Using 7.0 will also correct it, but after experimentation I chose to use the latest value.)

Pages and pages of grief and agony on the net would've been dispelled if somebody had known in all the many conversations that have ensued about this message. I feel really bad when I see people asking questions over and over again and the answer never emerges.

For the record, I found the answer here after much searching, posted by "boonkit" on 2005-03-29. But I had the idea in the back of my mind this could probably be solved by changing the TDS version, and if I hadn't found it here I was going to be cycling through each possible value and trying them.

Now I want to figure out how to set this in my DBI DSN string. Until this moment, I didn't actually have to have a freetds.conf file. :)

Here's hoping that the next poor soul to encounter this error will Google for it and find the solution spelled out plainly here. For the record, if you are such a soul and are clueless about what a freetds.conf file is and where to find yours, post here to give me a ring, and assuming I'm not dead by then, I'll try to help you out. :)

Update: Experimented with the different TDS protocol versions, discovered 8.0 also works, decided to use that.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.