Apologies if this is answered elsewhere. I keep getting the error message XQuery [Mytable.XMLData.nodes()]: There is no element named 'Answer'
SELECT
ref.value('/','nvarchar(1000)')
FROM Mytable CROSS APPLY xmldata.nodes('Answer') R(ref)
-
--XML of Row
<Answer xmlns="http://TempNameSpace.com/AnswerData.xsd" Type="Deliverable">
<Deliverable>
<Title>test</Title>
<Description>test</Description>
<DueDate>2010-02-16T08:59:59</DueDate>
</Deliverable>
</Answer>
I've tried several different variations on getting the root node ('answer'), or any of the child nodes if, however i change my statement to read
SELECT
ref.value('/','nvarchar(1000)')
FROM Mytable CROSS APPLY xmldata.nodes('/') R(ref)
i get the result testtest2010-02-16T08:59:59
I'd ultimately like this data in tabular format, something like
SELECT
ref.value('/Title','nvarchar(1000)') as Title
ref.value('/Description','nvarchar(1000)') as Description
etc..
FROM Mytable CROSS APPLY xmldata.nodes('/Deliverable') R(ref)
Thanks for your help