Click Fraud Protection
PHP related blog, freelancer to hire!

MS SQL Server 2008 connection from ZF problem? SOLVED

If you have message like ‘General error: 20018 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.’ probably one of your columns is invalid.

In my scenario i had one column nvarchar(max).

Solution to that problem is to build query using CAST f.e.:
‘synopsis’ => new Zend_Db_Expr(‘CAST(synopsis AS nvarchar(4000))’),

1 Comment
  1. thanks for posting your solution – I ran into this very problem using a PHP based CMS and Freetds on linux to talk to a remote SQLServer and your fix works for me too.

Leave a Reply