ZF-7698: Cannot 'describeTables' with SQLServer 2000, using Zend_Db_Adapter_Sqlsrv
Connecting to SQLServer 2000 using the latest Sqlsrv driver (1.1 CTP Aug 09 release), with the Microsoft SQL Server Native Client 2008, on a windows IIS server (6.0) using FastCGI and PHP v5.2.10
The describeTable function fails with the exception: 'The connection cannot process this operation because there is a statement with pending results. To make the connection available for other queries, either fetch all results or cancel or free the statement. For more information, see the product documentation about the MultipleActiveResultSets connection option'
Line 436 in Zend\Db\Adapter\SqlSrv.php executes a stored procedure, but the script cannot run the next stored procedure on line 455 without first clearing the statement.
I propose unsetting the first statement after the result set is returned:
Line 439: unset($stmt);
This will resolve the describeTable issue with SQLServer 2000.