Difference between PHP SQL Server Driver and SQLCMD when running queries

Giscosediance

New Member
Why is that the SQL Server PHP Driver has problms with long running queries?Every time I have a query that takes a while to run, I get the following errors from sqlsrv_errors() in the below order:\[quote\] Shared Memory failure, Communication Link Failure, Timeout failure\[/quote\]But if I try the same query with SQLCMD.exe it comes back fine. Does the PHP SQL Server Driver have somewhere that a no timeout can be set?Whats the difference between running queries via SQLCMD and PHP Driver?Thanks all for any helpTypical usage of the PHP Driver to run a query.\[code\]function already_exists(){ $model_name = trim($_GET['name']); include('../includes/db-connect.php'); $connectionInfo = array('Database' => $monitor_name); $conn = sqlsrv_connect($serverName, $connectionInfo); $tsql = "SELECT model_name FROM slr WHERE model_name = '".$model_name."'"; $queryResult = sqlsrv_query($conn, $tsql); if($queryResult != false){ $rows = sqlsrv_has_rows($queryResult); if ($rows === true){ return true; }else{ return false; } }else{ return false; } sqlsrv_close($conn);}\[/code\]
 
Back
Top