"; $connectionInfo = [ 'Database' => 'xxx', 'UID' => 'xxx', 'PWD' => 'xxx', 'CharacterSet' => 'UTF-8', 'LoginTimeout' => 30, 'MultipleActiveResultSets' => 0, 'TrustServerCertificate' => 1, 'Encrypt' => 0, ]; sqlsrv_configure("WarningsReturnAsErrors", 1); $handle = sqlsrv_connect('xxx', $connectionInfo); $query = "INSERT INTO dbo.TestTable (TestColumn) VALUES (?)"; $parameterValue = "Test value."; $parameterReference[0] = [ & $parameterValue, SQLSRV_PARAM_IN, null, SQLSRV_SQLTYPE_VARCHAR(8000) ]; $queryHandle = sqlsrv_prepare($handle, $query, $parameterReference); echo "Row 1\n"; $r1 = sqlsrv_execute($queryHandle); if ($r1 === false) { print_r(sqlsrv_errors(SQLSRV_ERR_ALL)); } echo "Row 2\n"; $r2 = sqlsrv_execute($queryHandle); if ($r2 === false) { print_r(sqlsrv_errors(SQLSRV_ERR_ALL)); } echo "Done\n";