Article ID: 310378 - Last Review: March 13, 2006 - Revision: 2.1 The XML data row is truncated at 2,033 characters when you use the SqlDataReader objectThis article was previously published under Q310378
This article refers to the following Microsoft .NET Framework Class Library namespace:
On This PageSYMPTOMS
When you read Extensible Markup Language (XML) data from Microsoft SQL Server by using the SqlDataReader object, the XML in the first column of the first row is truncated at 2,033 characters. You expect all of the contents of the XML data to be contained in a single row and column.
CAUSE
This behavior occurs because, for XML results greater than 2,033 characters in length, SQL Server returns the XML in multiple rows of 2,033 characters each.
RESOLUTION
To resolve this problem, use the ExecuteXmlReader method to read FOR XML queries. For additional information about how to use ExecuteXmlReader with SQL Server FOR XML queries, click the article numbers below to view the articles in the Microsoft Knowledge Base:
316016
(http://support.microsoft.com/kb/316016/
)
How to use the ExecuteXmlReader method of the SqlCommand class in Visual Basic .NET
316701
(http://support.microsoft.com/kb/316701/
)
How to use the ExecuteXmlReader method of the SqlCommand class in Visual C# .NET
307224
(http://support.microsoft.com/kb/307224/
)
How to use XML in connected and disconnected ADO.NET applications
STATUSThis behavior is by design. MORE INFORMATIONSteps to reproduce the problem
| Article Translations
|

Back to the top
