query timing out
- I'm running a php script from the command line against SQL server 2005 using the MS driver for PHP and getting time outs. The query takes about 2 minutes from SQL Server Management Studio and returns > 300,000 rows. There are multiple queries in the script and for each one I do a sqlsrv_connect(), execute the query and then sqlsrv_free_stmt() and sqlsrv_close() Output from sqlsrv_errors():
Array ( [0] => Array ( [0] => 08S01 [SQLSTATE] => 08S01 [1] => 258 [code] => 258 [2] => [Microsoft][SQL Native Client]Shared Memory Provider: Timeout error [258]. [message] => [Microsoft][SQL Native Client]Shared Memory Provider: Timeout error [258]. ) [1] => Array ( [0] => 08S01 [SQLSTATE] => 08S01 [1] => 258 [code] => 258 [2] => [Microsoft][SQL Native Client]Communication link failure [message] => [Microsoft][SQL Native Client]Communication link failure ) [2] => Array ( [0] => 08S01 [SQLSTATE] => 08S01 [1] => 0 [code] => 0 [2] => [Microsoft][SQL Native Client]Communication link failure [message] => [Microsoft][SQL Native Client]Communication link failure ) )
All Replies
- What are the parameters for your sql_connect()? All default?
- Yep, all default
Please post the PHP code and we’ll investigate further.
We need to know as well the execution environment (Windows OS and PHP version).
From your error message, I gather that you are using the version 1.0 of the driver. Can you repeat your test with version 1.1?
Thank you,
Serban
Serban Iliescu - MSFT- Installed the v1.1 driver and the SQL Server 2008 Native Client (as required by the v1.1 driver) and am still getting the timeout, although the error is different this time.Any ideas?Output from sqlsrv_errors():Array([0] => Array([0] => 08S01[SQLSTATE] => 08S01[1] => 258[code] => 258[2] => [Microsoft][SQL Server Native Client 10.0]TCP Provider: Timeout error [258].[message] => [Microsoft][SQL Server Native Client 10.0]TCP Provider: Timeout error [258].)[1] => Array([0] => 08S01[SQLSTATE] => 08S01[1] => 258[code] => 258[2] => [Microsoft][SQL Server Native Client 10.0]Communication link failure[message] => [Microsoft][SQL Server Native Client 10.0]Communication link failure)[2] => Array([0] => 08S01[SQLSTATE] => 08S01[1] => -2147467259[code] => -2147467259[2] => [Microsoft][SQL Server Native Client 10.0]Communication link failure[message] => [Microsoft][SQL Server Native Client 10.0]Communication link failure))
Please post the PHP code that fails. The error info is meaningless unless we understand the context in which it occurs. We need to know as well the execution environment (Windows OS and PHP version).
Thank you,
Serban
Serban Iliescu - MSFT


