Returns information about active handles that have been opened by sp_xml_preparedocument.
Session ID of the session that holds this XML document handle.
XML document handle ID returned by sp_xml_preparedocument.
Internal handle ID used for the associated namespace document that has been passed as the third parameter to sp_xml_preparedocument. NULL if there is no namespace document.
Handle to the text of the SQL code where the handle has been defined.
Number of characters into the currently executing batch or stored procedure at which the sp_xml_preparedocument call occurs. Can be used together with the sql_handle, the statement_end_offset, and the sys.dm_exec_sql_text dynamic management function to retrieve the currently executing statement for the request.
Number of characters into the currently executing batch or stored procedure at which the sp_xml_preparedocument call occurs. Can be used together with the sql_handle, the statement_start_offset, and the sys.dm_exec_sql_text dynamic management function to retrieve the currently executing statement for the request.
Timestamp when sp_xml_preparedocument was called.
Size of the unparsed XML document in bytes.
Size of the unparsed XML namespace document, in bytes. NULL if there is no namespace document.
Number of OPENXML calls with this document handle.
Number of rows returned by all previous OPENXML calls for this document handle.
Milliseconds since the last OPENXML call. If OPENXML has not been called, returns milliseconds since the sp_xml_preparedocument call.
The lifetime of sql_handles used to retrieve the SQL text that executed a call to sp_xml_preparedocument outlives the cached plan used to execute the query. If the query text is not available in the cache, the data cannot be retrieved using the information provided in the function result. This can occur if you are running many large batches.
The following example selects all active handles.
select * from sys.dm_exec_xml_handles(0)