Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: You receive error message 6603 or text data may be truncated when you select a text data type through the OPENXML provider in SQL Server 2000


View products that this article applies to.

This article was previously published under Q285006
BUG #: 236142 (Shiloh_bug)

↑ Back to the top


Symptoms

When you select character data that is a Text data type through the OPENXML rowset provider, the text data may be truncated or you may receive the following error message:

Server: Msg 6603, Level 16, State 1
XML parsing error: System error: 265926.
If the text value tag in the XML code contains more than 3,956 characters but less than 7,907 characters, you receive the 6603 error message. If the value tag contains more than 7,907 characters, the text data is truncated silently.

↑ Back to the top


Resolution

SQL Server 2000

To resolve this problem, obtain the latest service pack for Microsoft 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

MDAC

To resolve this problem, obtain the latest service pack for Microsoft Data Access Components 2.6. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
300635� INFO: How to obtain the latest MDAC 2.6 service pack

Hotfix

Note The following hotfix was created before the release of Microsoft SQL Server 2000 Service Pack 1.

The English version of this fix should have the following file attributes or later:
   Date        Version        Size    File name 
   ---------------------------------------------------
   01/23/2001  8.1.7123.0   688,912   Msxml2.dll	
   01/23/2001  8.1.7123.0    21,776   Msxml2a.dll	
   01/23/2001  8.1.7123.0    37,648   Msxml2r.dll
   01/23/2001  8.1.7123.0    26,384   Xmlinst.exe
				
If you are upgrading from the original released version of SQL Server 2000 to Microsoft SQL Server 2000 Service Pack 3 (SP3), this problem may occur. To resolve this problem, install the security update that is described in the following Microsoft Knowledge base article:
318202� MS02-008: XMLHTTP control in MSXML 2.6 can allow access to local files
The security update that is discussed in Microsoft Security Bulletin MS02-008 has the required files (version 8.2.8307.0).

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article.

SQL Server 2000

This problem was first corrected in SQL Server 2000 Service Pack 1.

MDAC

This problem was first corrected in Microsoft Data Access Components 2.6 Service Pack 1.

↑ Back to the top


More information

Steps to reproduce the problem

  1. Create the stored procedure from the following script:
    /** Begin Script for reproducing the problem **/ 
    
    DROP PROCEDURE test_openxml
    GO
    CREATE PROCEDURE test_openxml
      @i_xml text
    AS
      begin
        declare @hr   integer
        declare @hdoc integer
    
        exec @hr = sp_xml_preparedocument @hdoc output,@i_xml
    
        if @hr = 0
        begin
           select datalength(value) 
              from openxml(@hdoc,'root/data',1) with(value text)
           exec sp_xml_removedocument @hdoc
        end
      end
    GO
    EXEC test_openxml '<?xml version="1.0" encoding="UTF-8"?>
    <root>
         <data value="<insert at least 4000 characters here>"/>
    </root>'
    GO
    
    /** End Script for reproducing the problem **/ 
    					
  2. Call this procedure and provide a valid XML string as parameter. The value of the data tag should contain at least 4,000 characters at the indicated location.
You either receive the 6603 error message or the OPENXML rowset provider truncates the text column after about 3,900 characters. The datalength function returns the actual length. The actual length is shorter than the string that is provided in the XML code.

↑ Back to the top


Keywords: kbhotfixserver, kbbug, kbfix, kbmdac260sp1fix, kbmsxmlnosweep, kbqfe, kbsqlserv2000sp1fix, kbqfe, KB285006

↑ Back to the top

Article Info
Article ID : 285006
Revision : 10
Created on : 9/26/2005
Published on : 9/26/2005
Exists online : False
Views : 518