How to use SQL 2000 to generate XML

Source: Internet
Author: User
Tags how to use sql

I have mentioned SQL2k's support for XML when introducing SQL2k. Using the for XML statement, you can easily convert the execution result into an XML, this greatly improves the system running efficiency and development speed. For details, see Books Online.
However, the method for accessing the returned XML using ADO (Required ADO 2.6) is different from that of the original Recordset. If you still use Recordset for access, you can only get XML Schema in Unicode format, but cannot get XML content.
In fact, this problem can be easily solved, but I thought I was familiar with ADO and did not look at Help carefully, so I did not find that ADO uses Stream to get and return XML.
The Command object has two attributes: Input Stream and Output Stream. The attribute value is an IUnknown interface. You can assign an XML Parser interface to it, or directly use Request and Response. The advantage is that you do not need to generate a Recordset, and you do not need to save the data, thus saving the system overhead.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.