--TEST-- GitHub issue #937 - getting metadata will not fail after an UPDATE / DELETE statement --DESCRIPTION-- Verifies that sqlsrv_field_metadata will return an empty array after processing an UPDATE / DELETE query that returns no fields. --ENV-- PHPT_EXEC=true --SKIPIF-- --FILE-- "buffered"); $tsql = "DELETE FROM $tableName WHERE dummyColumn = 'updated'"; $stmt = sqlsrv_query($conn, $tsql, array(), $options); $fieldmeta = sqlsrv_field_metadata($stmt); var_dump($fieldmeta); dropTable($conn, $tableName); dropProc($conn, $procName); sqlsrv_free_stmt($stmt); sqlsrv_close($conn); ?> --EXPECT-- array(2) { [0]=> array(6) { ["Name"]=> string(2) "id" ["Type"]=> int(4) ["Size"]=> NULL ["Precision"]=> int(10) ["Scale"]=> NULL ["Nullable"]=> int(0) } [1]=> array(6) { ["Name"]=> string(11) "dummyColumn" ["Type"]=> int(12) ["Size"]=> int(10) ["Precision"]=> NULL ["Scale"]=> NULL ["Nullable"]=> int(0) } } array(0) { } The value returned: updated array(0) { } array(0) { }