Reputation: 93
I am trying to select certain values that are posted back to our sql server from an xml into one field as a string..
Example:
<?XMLVERSION><result><id>0</id><response>success</response><did>B2A5DY53</did><price>0.00</price></result>
How would I select just the value between "price" ' ' "/price"?
Upvotes: 0
Views: 437
Reputation: 65567
You can use the built-in ExtractValue()
function for this:
SELECT ExtractValue('<result>
<id>0</id>
<response>success</response>
<did>B2A5DY53</did>
<price>0.00</price>
</result>', '/result/price')
Upvotes: 1