Commit 3c12b036 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge pull request #490 from deeky666/suppress-sqlsrv-driver-server-warnings

Don't return warnings as errors in sqlsrv driver
parents 9975da98 3e320928
...@@ -47,6 +47,10 @@ class SQLSrvConnection implements Connection ...@@ -47,6 +47,10 @@ class SQLSrvConnection implements Connection
*/ */
public function __construct($serverName, $connectionOptions) public function __construct($serverName, $connectionOptions)
{ {
if ( ! sqlsrv_configure('WarningsReturnAsErrors', 0)) {
throw SQLSrvException::fromSqlSrvErrors();
}
$this->conn = sqlsrv_connect($serverName, $connectionOptions); $this->conn = sqlsrv_connect($serverName, $connectionOptions);
if ( ! $this->conn) { if ( ! $this->conn) {
throw SQLSrvException::fromSqlSrvErrors(); throw SQLSrvException::fromSqlSrvErrors();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment