The example allows us to learn more about the internal mechanism of the various settings, and we'll take a closer look at the optional element xmldata for the XML statement below.
If you set this option, the Xml-data schema will be included in the result set. The following is an SQL statement:
SET ROWCOUNT 3
SELECT Orders.OrderID, Orders.orderdate, ProductID
From Orders, [order Details]
WHERE Orders.OrderID = [Order Details]. OrderID
ORDER BY Orders.OrderID
For XML AUTO, XMLDATA
ELEMENTS
The elements option indicates that each data column is returned as a child element rather than as a property. If you use Auto mode, you can use this option only.
BINARY BASE64
Use this option to indicate that you want to represent binary data in the Base64 encoding format.
There is more to the use of XML clauses, you'd better refer to the SQL online books.
Online Guide
The SQL Server online book describes the use of FOR XML clauses. It also mentions a number of limitations to be aware of when using this clause. For example, a FOR XML phrase cannot be combined with a view definition or a COMPUTE BY clause. You may wish to refer to the documentation for more details.
This article is just a simple description of the FOR XML clause, and here's a reminder that this is just a bit of XML integration with SQL Server, and other issues include IIS OpenXML functions and template files. It looks like this, and every pore in SQL Server is dripping with XML.
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.