【发布时间】:2010-12-10 17:37:23
【问题描述】:
我正在使用 PHP 的 MS 驱动程序从命令行针对 SQL Server 2005 运行一个 php 脚本并获得超时。从 SQL Server Management Studio 查询大约需要 2 分钟,并返回 > 300,000 行。
脚本中有多个查询,我对每个查询执行sqlsrv_connect(),执行查询,然后执行sqlsrv_free_stmt() 和sqlsrv_close()
来自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
)
)
【问题讨论】:
标签: php sql-server sql-server-2005 timeout