I have one XML String as below :
<XML>
<ProductDetail>
<Barcode>170604658</Barcode>
<PropertyDetail>
<PropertyKey>Size</PropertyKey>
<PropertyValue>XXL</PropertyValue>
<PropertyKey>ProdTaxType</PropertyKey>
<PropertyValue>5%</PropertyValue>
</PropertyDetail>
</ProductDetail>
</XML>
i m reading the XML Data via below small query in sp:
SELECT *
FROM OPENXML(@hDoc, 'XML/ProductDetail/PropertyDetail', 2) WITH
(
PropertyKey VARCHAR(200) ,
PropertyValue VARCHAR(200)
)XML
BUT , FOR above i m getting one row data as below :
PropertyKey PropertyValue
Size XXL
BUT , as per XML Defined i want to get the data as per below :
PropertyKey PropertyValue
Size XXL
ProdTaxType 5%
FOR the same chile node name i am getting only one record from xml string. So, please suggest in above sp.
EXEC sp_xml_preparedocument @idoc OUTPUT, @doc;in your sample? `