Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 2.32 KB

sp-xml-removedocument-transact-sql.md

File metadata and controls

66 lines (47 loc) · 2.32 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_xml_removedocument (Transact-SQL)
Removes the internal representation of the XML document specified by the document handle and invalidates the document handle.
markingmyname
maghan
randolphwest
03/07/2025
sql
system-objects
reference
sp_xml_removedocument_TSQL
sp_xml_removedocument
sp_xml_removedocument
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.

A parsed document is stored in the internal cache of [!INCLUDE ssNoVersion]. The MSXML parser (msxmlsql.dll) uses one-eighth the total memory available for [!INCLUDE ssNoVersion]. 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

[!INCLUDE extended-stored-procedures]

hdoc

The handle to the newly created document. A handle that isn't 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;

Related content