Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeTDS and nvarchar(MAX) in MSSQL-2005+

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Chad Johnson <chadjamesjohnson AT gmail.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] FreeTDS and nvarchar(MAX) in MSSQL-2005+
  • Date: Tue, 10 Feb 2009 19:27:30 -0600

> "[FreeTDS][SQL Server]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. SQLState=42000
> ErrorCode=4004]"
>
> Any clues on this? I am attaching the FreeTDS configuration file along
> with this email. On the similar note does FreeTDS 0.82 support
> reading of nchar, nvarchar, ntext fields
> from MSSQL 2005/08 server?

When using a Perl / DBD::ODBC stack I was able to extract nvarchar /
ntext / nvarchar(max) (in full unicode glory) with 0.82. Insert /
update's would not work. The prerelease of 0.83 fixed that problem
(i.e. 0.83 now allows you to bind character data as SQL_WVARCHAR).

FreeTDS itself does support these datatypes. It's up to your software
stack to ensure that these features work correctly though.

Be on the lookout for :

1.) Using, at least, tds version 7.0 or above
- freetds.conf property `tds version`
2.) Setting the charset to UTF-8
- freetds.conf property `client charset`
3.) Setting the upper limit on text / image / nvarchar(max)
- freetds.conf property `text size`

Also, if you are using PHP this seems to be a known issue if your
peruse the MSSQL comments at :

http://us3.php.net/function.mssql-query

You'll see other people running into this issue.

-Chad J




Archive powered by MHonArc 2.6.24.

Top of Page