TAILIEUCHUNG - Hướng dẫn học Microsoft SQL Server 2008 part 53

Tìm kiếm chuỗi trong một chuỗi không thể sử dụng cấu trúc b-cây của một chỉ số để thực hiện một chỉ mục tìm kiếm nhanh vì vậy nó phải thực hiện một bảng quét thay vào đó, như thể hiện trong hình 19-1. | Part III Beyond Relational The system stored procedure xp_xml_preparedocument takes an optional fourth argument that accepts the namespace declarations. If the XML document contains namespace declarations this parameter can be used to specify the namespaces declared in the XML document. The following example shows how to do this DECLARE hdoc INT DECLARE xml VARCHAR MAX SET xml itm Items xmlns itm http items itm Item ItemNumber D001 Quantity 1 Price itm Item ItemNumber Z001 Quantity 1 Price itm Items -- Step 1 initialize XML Document Handle EXEC sp_xml_preparedocument hdoc OUTPUT xml itm Items xmlns itm http items -- Step 2 Call OPENXML SELECT FROM OPENXML @hdoc itm Items itm Item WITH ItemNumber CHAR 4 @ItemNumber Quantity INT Quantity Price MONEY Price -- Step 3 Free document handle exec sp_xml_removedocument hdoc ItemNumber Quantity Price D001 1 Z001 1 Because OPENXML needs a three-step process to shred each XML document it is not suitable for set-based operations. It cannot be called from a scalar or table-valued function. If a table has an XML column and a piece of information is to be extracted from more than one row with OPENXML a WHILE loop is needed. Row-by-row processing has significant overhead and will typically be much slower than a set-based operation. In such cases XQuery will be a better choice over OPENXML . Using OPENXML may be expensive in terms of memory usage too. It uses the MSXML parser internally using a COM invocation which may not be cheap. A call to xp_xml_preparedocument parses the XML document and stores it in the internal cache of SQL Server. The MSXML parser uses one-eighth of the total memory available to SQL Server. Every document handle initialized by xp_xml_prepare document should be released by calling the xp_xml_releasedocument procedure to avoid memory leaks. 482 Manipulating XML Data 18 XSD and XML Schema Collections XSD XML .

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.