PRB: SELECT...FOR XML AUTO Results Are Separated into Lines of 2033 Chars with ODBC (275583)
The information in this article applies to:
- Microsoft SQL Server 7.0
- Microsoft SQL Server 2000 (all editions)
This article was previously published under Q275583 SYMPTOMS
When you use Query Analyzer (or any other ODBC application) to retrieve data using the FOR XML AUTO clause, only 2033 characters are returned per row. The application's maximum output width setting cannot be used to make the rows longer.
CAUSE
ODBC, which is used by Query Analyzer, does not handle the FOR XML clause. It returns the data in 4K rows which, allowing for overhead and double-byte character set (DBCS), comes to 2033 characters.
WORKAROUND
This is a known limitation with ODBC. Because Query Analyzer uses ODBC, there is no workaround for this problem when using Query Analyzer. For any custom applications, you can use any of the following methods instead:
- Use OLE DB instead of ODBC. OLE DB supports the FOR XML clause and will append the data together. For this to occur, use adExecuteStream for implementing ADO on top of OLE DB, or use Query Interface's ISequentialStream if using OLE DB directly.
- Use XSLT to handle the formatting.
- Code your ODBC application to append the rows together as necessary.
Modification Type: | Major | Last Reviewed: | 10/16/2003 |
---|
Keywords: | kbpending kbprb KB275583 |
---|
|