Skip to content

Latest commit

 

History

History
59 lines (45 loc) · 2.35 KB

File metadata and controls

59 lines (45 loc) · 2.35 KB
title sp_xml_removedocument (Transact-SQL)
description sp_xml_removedocument (Transact-SQL)
author markingmyname
ms.author maghan
ms.date 03/14/2017
ms.service sql
ms.subservice system-objects
ms.topic reference
f1_keywords
sp_xml_removedocument_TSQL
sp_xml_removedocument
helpviewer_keywords
sp_xml_removedocument
dev_langs
TSQL

sp_xml_removedocument (Transact-SQL)

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance]

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.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

  
sp_xml_removedocument hdoc  

Arguments

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

Return Code Values

0 (success) or >0 (failure)

Permissions

Requires membership in the public role.

Examples

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;  

See Also


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)