DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 2803994 - Last Review: April 15, 2013 - Revision: 3.0

On This Page

Symptoms

When you run a query that contains large object (LOB) data to load into a Transact-SQL variable in Microsoft SQL Server 2008, Microsoft SQL Server 2012 or Microsoft SQL Server 2008 R2, data corruption occurs. For example, you run the following query to copy XML data from a database column to an XML variable:
Declare @OUTXML as XML
SELECT @OUTXML = DataXml FROM Table_1 WHERE id=1 

In this situation, the SELECT statement runs when other threads try to update the same XML column. This behavior may cause data corruption. Additionally, you receive one of the following error messages when you perform any read and write operation on the corrupted XML column:
  • The XML data type is damaged.
  • Unexpected end of file has occurred.
Notes
  • The issue typically occurs during high concurrent load operations.
  • When you use a Log Reader agent to read the corrupted XML data from a table that is part of a publication article list for transactional replication, you receive the following error message:

    The XML data type is damaged. (Source: MSSQLServer, Error number: 6611)

Cause

This issue occurs because a lock on the LOB data column is released before the LOB data is copied from the database column to the LOB data type variable. Any concurrent query can update the same LOB data before the copy process is complete during the copy process. Therefore, data corruption occurs.

Resolution

Cumulative update information

Cumulative Update 7 for SQL Server 2012

The fix for this issue was first released in Cumulative Update 7. For more information about how to obtain this cumulative update package for SQL Server 2012, click the following article number to view the article in the Microsoft Knowledge Base:
2823247  (http://support.microsoft.com/kb/2823247/ ) Cumulative update package 7 for SQL Server 2012
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2692828  (http://support.microsoft.com/kb/2692828/ ) The SQL Server 2012 builds that were released after SQL Server 2012 was released

Cumulative Update 12 for SQL Server 2008 R2 Service Pack 1

The fix for this issue was first released in Cumulative Update 12. For more information about how to obtain this cumulative update package for SQL Server 2008 R2 Service Pack 1, click the following article number to view the article in the Microsoft Knowledge Base:
2828727  (http://support.microsoft.com/kb/2828727/ ) Cumulative update package 12 for SQL Server 2008 R2 Service Pack 1
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 Service Pack 1 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2567616  (http://support.microsoft.com/kb/2567616/ ) The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 Service Pack 1 was released

Cumulative Update 10 for SQL Server 2008 Service Pack 3

The fix for this issue was first released in Cumulative Update 10. For more information about how to obtain this cumulative update package for SQL Server 2008 Service Pack 3, click the following article number to view the article in the Microsoft Knowledge Base:
2814783  (http://support.microsoft.com/kb/2814783/ ) Cumulative update package 10 for SQL Server 2008 Service Pack 3
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 Service Pack 3 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2629969  (http://support.microsoft.com/kb/2629969/ ) The SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 3 was released

Cumulative Update 5 for SQL Server 2008 R2 Service Pack 2 (SP2)

The fix for this issue was first released in Cumulative Update 5. For more information about how to obtain this cumulative update package for SQL Server 2008 R2 S2008 R2 SP2, click the following article number to view the article in the Microsoft Knowledge Base:
2797460  (http://support.microsoft.com/kb/2797460/ ) Cumulative update package 5 for SQL Server 2008 R2 S2008 R2 SP2
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 S2008 R2 SP2 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2730301  (http://support.microsoft.com/kb/2730301/ ) The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 Service Pack 2 was released

Status

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



Applies to
  • Microsoft SQL Server 2008 R2 Service Pack 2
  • Microsoft SQL Server 2008 R2 Developer
  • Microsoft SQL Server 2008 R2 Enterprise
  • Microsoft SQL Server 2008 R2 Standard
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 Express
  • Microsoft SQL Server 2008 Web
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2008 Workgroup
  • Microsoft SQL Server 2012 Developer
  • Microsoft SQL Server 2012 Enterprise
  • Microsoft SQL Server 2012 Express
  • Microsoft SQL Server 2012 Standard
  • Microsoft SQL Server 2012 Web
  • SQL Server 2012 Enterprise Core
Keywords: 
kbqfe kbfix kbsurveynew kbexpertiseadvanced KB2803994
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support