| title | sp_xml_removedocument (Transact-SQL) | Microsoft Docs | ||
|---|---|---|---|
| ms.custom | |||
| ms.date | 03/14/2017 | ||
| ms.prod | sql | ||
| ms.prod_service | database-engine | ||
| ms.service | |||
| ms.component | system-stored-procedures | ||
| ms.reviewer | |||
| ms.suite | sql | ||
| ms.technology |
|
||
| ms.tgt_pltfrm | |||
| ms.topic | language-reference | ||
| f1_keywords |
|
||
| dev_langs |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | f9dca50a-8baf-4170-90bc-e72783ce5b73 | ||
| caps.latest.revision | 18 | ||
| author | edmacauley | ||
| ms.author | edmaca | ||
| manager | craigg | ||
| ms.workload | Inactive |
[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx-md]
Removes the internal representation of the XML document specified by the document handle and invalidates the document handle.
Note
A parsed document is stored in the internal cache of [!INCLUDEssNoVersion]. The MSXML parser (Msxmlsql.dll) uses one-eighth the total memory available for [!INCLUDEssNoVersion]. To avoid running out of memory, run sp_xml_removedocument to free up the memory.
Transact-SQL Syntax Conventions
sp_xml_removedocument hdoc
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)
sys.dm_exec_xml_handles (Transact-SQL)
sp_xml_preparedocument(Transact-SQL)
OPENXML (Transact-SQL)