I am not getting any results so what am I doing wrong?
I have tried the examples that are given in this forum and in tech documentation.
This is the data in a table called OrderStatusResponse_2019
in a column called Response_XML
with a datatype of XML
. I am trying to get the resulttype back for this xml with this code.
DECLARE @Table TABLE (Response_XML XML)
INSERT INTO @Table (Response_XML)
VALUES (<orderStatusSummaryReply xmlns="http://www.airversent.com/integration" transactionId="1" timestamp="2019-01-21T21:13:19.144Z">
<result>
<resultType>success</resultType>
</result>
</orderStatusSummaryReply>)
SELECT
XC.value('(resultType)[1]', 'NVARCHAR(10)') AS [ResultType]
FROM
OrderStatusResponse_2019
CROSS APPLY
Response_XML.nodes('/orderStatusSummaryReply/result') as T2(XC)
I am getting 0 rows returned. Why?
I should get back one row with Success in it. I'm getting 0 rows.