• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set SQLSRV Timelimit/QueryTimeOut

#1
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.
Reply

#2
PHP Code:
ini_set('mssql.timeout', 6); 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.