1
爲什麼我得到第二個SELECT
查詢的空白結果,第一個查詢返回結果。對於具有默認命名空間的元素,查詢XML數據失敗
Declare @myxml xml;
set @myxml = '<items count="2">
<item id="561" quantity="1" />
<item id="167" quantity="1" />
</items>'
select @myxml.query('//items');
Go
Declare @myxml xml;
set @myxml = '<ContactLog xmlns="http://adventure-works/contact">
<Contact Date="2008-09-02T10:12:00" Type="Email">
<Employee>adventure-works\linda3</Employee>
<Notes>Customer confirmed delivery of order 71935.</Notes>
</Contact>
<Contact Date="2008-06-02T15:07:00" Type="Phone">
<Employee>adventure-works\david8</Employee>
<Employee>adventure-works\linda3</Employee>
<Notes>Customer requested status update on order 71935. Informed customer it is being prepared for delivery.</Notes>
</Contact>
</ContactLog>';
select @myxml.query('//ContactLog');
*默認命名空間如何處理XML命名空間*是關鍵字.. – har07
har07對不起,但沒有得到它,請解釋。 – TechTurtle