CodeIgniter Forums

Full Version: Set SQLSRV Timelimit/QueryTimeOut
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
How do I set the TimeOut for EXEC the Query or Stored Procedure in SqlSrv PHP
Because i am using Codeigniter to call SQL-Server Stored Procedure.
For ex
"EXEC SP_Name"
some times its taking too long time, so the PHP page shows 500 Internal server error.

If any possible to set timeout in sqlsrv connection string or execution i have tried the below code

[b]$conn = sqlsrv_connect($host, array("UID"=>$user, "PWD"=>$pwd, "Database"=>"DBName", "LoginTimeout"=>5));
$result = sqlsrv_query($conn, $query, $params, array("QueryTimeout" => 30));[/b]

I have change the set_time_limit(25) also it taking more time

If possible to set the time limit the SP was stopped then i show the error description etc...

how do i fix this issue?


Thanks in Advance.
PHP Code:
ini_set('mssql.timeout', 6);