Edit report at http://bugs.php.net/bug.php?id=51964&edit=1
ID: 51964 Updated by: ka...@php.net Reported by: ovendrell at oip dot jazztel dot es Summary: mssql_query "Query Processor Error" -Status: Open +Status: Feedback Type: Bug Package: MSSQL related Operating System: Ubuntu PHP Version: 5.3.2 Block user comment: N New Comment: Hi Are you using SQL Server 2000? Have you tried this work-a-around if so: http://support.microsoft.com/kb/841404 For SQL Server 2005, I see there is an open bug at Microsoft Connect for this error: https://connect.microsoft.com/SQLServer/feedback/details/228950 Previous Comments: ------------------------------------------------------------------------ [2010-06-04 10:47:56] ovendrell at oip dot jazztel dot es I have more information about the problem. I have seen that the error occurs when you insert a record into the table EEES_AprenAssigPE. This table has a FK composed by 2 fields (IdPlaEst, CodiRes) to another table where CodiRes is a calculated field. If you delete the FK, the problem disappears. ------------------------------------------------------------------------ [2010-06-01 11:57:25] ovendrell at oip dot jazztel dot es Description: ------------ I generate a SQL statement dynamically in PHP script. When I execute this SQL query, the system crash with error "Query Processor Error: The query processor could not produce a query plan". If I execute the same query directly on SQL server, it works. The SQL string is: $sql = "BEGIN TRY BEGIN TRANSACTION DELETE FROM EEES_AprenAssigPE WHERE IdAssig like '200166' AND Curs=2009; INSERT INTO EEES_AprenAssigPE (IdPlaEst, IdAssig, CodiRes, Curs) VALUES ('GEL01', '200166', 'C2', 2009); INSERT INTO EEES_AprenAssigPE (IdPlaEst, IdAssig, CodiRes, Curs) VALUES ('GEL01', '200166', 'E23', 2009); INSERT INTO EEES_AprenAssigPE (IdPlaEst, IdAssig, CodiRes, Curs) VALUES ('GEL01', '200166', 'E23.7', 2009); SELECT 1 AS OK; COMMIT TRANSACTION; END TRY BEGIN CATCH SELECT -1 AS OK; ROLLBACK TRANSACTION; END CATCH"; ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=51964&edit=1