PHP Error: unable to get Memo fields from HRNET

When I was doing select statement from HRNET database, one of the problems was that I got error looking like this:
warning: mssql_query() [function.mssql-query]: message: 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 is due to mssql driver not supporting table fields of type ntext. To avoid this change your sql request from

select ntextfield from table

to

select CAST(ntextfield AS TEXT) as ntextfield from table

p.s. Update for this issue:
Instead of using mssql library in php, use sqlsrv – less problems and resolves other issues with mssql (as limited length of the table-name or field-name)

This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *