TAILIEUCHUNG - Microsoft SQL Server 2005 Developer’s Guide- P13

Microsoft SQL Server 2005 Developer’s Guide- P13:This book is the successor to the SQL Server 2000 Developer’s Guide, which was extremely successful thanks to all of the supportive SQL Server developers who bought that edition of the book. Our first thanks go to all of the people who encouraged us to write another book about Microsoft’s incredible new relational database server: SQL Server 2005. | Chapter 7 Developing with XML 239 Name Last_Name Brown Last_Name First_Name Kevin First_Name Name Employee Employee Employee_ID 3 Name Last_Name Tamburello Last_Name First_Name Roberto First_Name Name Employee For more information about using the XML Explicit mode see the SQL Server 2005 BOL. Type Mode When XML data types are returned using the FOR XML clause s Type mode they are returned as XML data types. You can see an example of using the FOR XML clause with the XML Type directive here SELECT DocID MyXMLDoc FROM MyXMLDocs WHERE DocID 1 FOR XML AUTO TYPE NOTE ------ This listing uses the example MyXMLDocs table that was created earlier in this chapter. nu query returns the relational DocID column along with the MyXMLDoc XML data type column. It uses the FOR XML AUTO clause to return the results as XML. The TYPE directive specifies that the results will be returned as an XML data type. You can see the results of using the Type directive here MyXMLDocs DocID 1 MyXMLDoc MyXMLDoc xmlns http MyXMLDocSchema DocumentID 1 DocumentID DocumentBody Modified Body DocumentBody MyXMLDoc MyXMLDoc MyXMLDocs 1 row s affected 240 Microsoft SQL Server 2005 Developer s Guide NOTE ------ The preceding listing was reformatted to make it more readable in the published page width. FOR XML Path The new FOR XML PATH mode provides increased power to shape XML results than either the FOR XML AUTO or FOR XML RAW mode but without the complexity of the FOR XML EXCLICIT mode. The new PATH mode allows users to specify the path in the XML tree where an element or attribute can be added. Essentially the new PATH mode is a simpler alternative to the FOR XML EXCPLICIT mode. It can accomplish most of the things the developers need with the use of universal tables and complex unions. However it is more limited than the FOR XML EXPLICIT mode. You can see an example of using the FOR XML PATH mode in the following listing SELECT Top 3 title FirstName LastName from FOR XML PATH This query

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.