php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51964 mssql_query "Query Processor Error"
Submitted: 2010-06-01 11:57 UTC Modified: 2013-02-18 00:34 UTC
From: ovendrell at oip dot jazztel dot es Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 5.3.2 OS: Ubuntu
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ovendrell at oip dot jazztel dot es
New email:
PHP Version: OS:

 

 [2010-06-01 11:57 UTC] 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";


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-04 10:47 UTC] 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-08-19 10:10 UTC] kalle@php.net
-Status: Open +Status: Feedback
 [2010-08-19 10:10 UTC] kalle@php.net
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
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 10 07:01:28 2024 UTC