Adding connection error check
Merge branch 'refs/heads/hotfix/sqlsrv' into 3.2/legacy