FIX: OPENXML May Leak Worktables in Memory (295053)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)
  • Microsoft XML 2.6

This article was previously published under Q295053
BUG #: 351736 (SHILOH_BUGS)

SYMPTOMS

When you use OPENXML to expose XML data directly to Transact-SQL manipulation, the following error message may appear in your application error log:
clean_tables_xact: active sdes for tabid -170425569

CAUSE

This regression bug was first seen in Build 6805. The use of the Msxml.dll file version 2.6 with hotfixes for Build 6805 do not dereference SQLOLEDB calls from IRowset to MSXML.

RESOLUTION

To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack

WORKAROUND

Use the version of the Msxml2.dll file provided with SQL Server to prevent the memory leak.

STATUS

Microsoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.

MORE INFORMATION

Step to Reproduce Behavior

  1. Run the following script from the SQL Query Analyzer:
    declare @strDoc nvarchar(2000)
    set @strDoc = '<!DOCTYPE root [ <!ELEMENT root (row)*> <!ELEMENT row (subrow)*> <!ELEMENT subrow EMPTY><!ATTLIST row dd CDATA #FIXED "dd value">]><root><row dd="dd value"/><row></row></root>'
    declare @h int
    exec sp_xml_preparedocument @h output, @strDoc
    select * from openxml(@h,'root/row',9) with (rid int '@mp:id',rparent int '@mp:parentid', dd char(10), xmltext ntext '@mp:xmltext')
    exec sp_xml_removedocument @h
    
    					
  2. Close the connection.
  3. Check the SQL Server error log.

Modification Type:MajorLast Reviewed:10/29/2003
Keywords:kbBug kbfix kbMSXMLnosweep kbSQLServ2000sp1fix KB295053