sp_xml_removedocument (Transact-SQL)


THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Removes the internal representation of the XML document specified by the document handle and invalidates the document handle.

System_CAPS_ICON_note.jpg Note

A parsed document is stored in the internal cache of SQL Server. The MSXML parser (Msxmlsql.dll) uses one-eighth the total memory available for SQL Server. To avoid running out of memory, run sp_xml_removedocument to free up the memory.

Applies to: SQL Server (SQL Server 2008 through current version).

Topic link icon Transact-SQL Syntax Conventions

sp_xml_removedocument hdoc  

Is the handle to the newly created document. A handle that is not valid returns an error. hdoc is an integer.

0 (success) or >0 (failure)

Requires membership in the public role.

The following example removes the internal representation of an XML document. The handle to the document is provided as input.

EXEC sp_xml_removedocument @hdoc;  

System Stored Procedures (Transact-SQL)
XML Stored Procedures (Transact-SQL)
sp_xml_preparedocument (Transact-SQL)
OPENXML (Transact-SQL)

Community Additions