PHP – mssql_query() Error
Background Knowledge
I’m running PHP v5.2.9-2 with SQL Server 2005 Express on Windows Server 2003 R2 SP2.
Error Message
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. (severity 16)
Solution
Specify the database columns within your database query (select filed1, field2 from foo). Avoid doing queries with the wildcard (*), select * from foo.
Source: PHP Manual on MSSQL_Query()


Adam, MS SQL Server trouble on PlanetMySQL? Why would the typical MySQL audience care?
Well it isn’t at all. It just so happens the posts I do for PHP and related are in one category. Most of the time its only MySQL. If its necessary I could split MySQL out on its own.
I am getting the same error message if I added ‘for xml’ clause in the query. specifying the fields doesn’t help.
I too am getting the same error message with the fields specified. I then tried this:
$string = mssql_query(“SELECT CAST(TEXT ProgramName) As ProgramName FROM ProgramsRussian where ProgramId = 194;”, $connection);
but that also didnt work