SQL query which doesn't work with MS SQL
|Reported by:||konus||Owned by:|
Description (last modified by alec)
I have the follwing enviroment:
- Windows Server 2008 R2 with IIS 7.5
- PHP 5.3.13
- "Microsoft SQL Driver v2.0 for PHP v5.2 in IIS" (installed via Microsoft Web Plattform installer)
- My connection string is: $rcmail_configdb_dsnw? = 'sqlsrv://sa:password@server\\instance/database';
After opening the addressbook, I get the following error in \logs\error
[31-May-2012 13:25:46 UTC] MDB2 Error: unknown error (-1): _doQuery: [Error message: Could not execute statement] [Last executed query: SELECT TOP 40 * FROM contacts AS c WHERE c.del<>1 AND c.user_id=2 ORDER BY (c.surname + c.firstname + c.name + c.email) ASC] [Native code: 402] [Native message: SQLState: 42000 Error Code: 402 Message: [Microsoft][SQL Server Native Client 11.0][SQL Server]Die Datentypen varchar und text sind im add-Operator inkompatibel.
The translation of the german error is:
the data types text and varchar are incompatible in the boolean AND operator
A quick google search shows that this is a common problem with MSSQL-DB, but I am not capable of solve this by myself.
I also tested 0.7.2 with the same result.
Change History (15)
comment:8 Changed 13 months ago by konus
- Resolution fixed deleted
- Status changed from closed to reopened