how to see SQL executed by sqlsrv_query

0

I run the following code:

$sql = "UPDATE [dbo].[NOTA_FISCAL] 
        SET [STATUS] = ?,
            [USUARIO]= ?,
            DATA_TRATAMENTO = (getdate()),
            [MOTIVO_CANCELAMENTO] = ?
        WHERE [ID_NOTA_FISCAL] = ?";
$params = [2,30,'',7];      
$options= ["Scrollable" => "forward", 'QueryTimeout' => 60];
sqlsrv_query($this->MSconn, $sql, $params, $options);

I would like to see the SQL that runs on the database by sqlsrv_query , because although in my head everything is right it is not running in the database.

Can you enable it to generate the log of executed queries or something like that?

I have now bypassed the bug disconnecting and reconnecting the database, however seeing the SQL run in the database would be interesting.

    
asked by anonymous 19.01.2018 / 13:09

0 answers