miércoles, 21 de agosto de 2019

Ignore sqlsrv error

Array ( [0] => Array ( [0] => 01000 [SQLSTATE] => 01000 [1] => 0 [code] => 0 [2] => [Microsoft][SQL Server Native Client 10.0][SQL Server]We Will Not Show Clicks,CTR and RPC Data For This Partner. [message] => [Microsoft][SQL Server Native Client 10.0][SQL Server]We Will Not Show Clicks,CTR and RPC Data For This Partner. ) )

When a message, e.g. from a SQL 'print' statement is executed, the sqlsrv driver forwards it through sqlsrv_errors().
The default setting is to treat all warnings as errors, so your query will fail...
Set the feature to treat warning as errors to false like this, so that the messages will not fail your query:
sqlsrv_configure('WarningsReturnAsErrors',0);
Also, don't forget to call sqlsrv_next_result($yourStmt); to scroll through all of the warnings and results.  When sqlsrv_next_result() returns NULL, you have reached the end of all results without any errors.

No hay comentarios:

Publicar un comentario