Skip to content
Advertisement

How do I extract a value from an XML column in SQL Server

I have a column SCORERESULTS in table CSE_ARCHIVEDCREDITSCORE.

Score results is an XML column.

I am trying to get the value 0.190325139 out of the XML line: <Column order="1" op="RNG2" start="0.18" end="0.2" title="Payment To Income Ratio">0.190325139</Column> I am clueless on how to pull it. I’m not familiar with XML, or really how to navigate it well.

Advertisement

Answer

You can use the below query. Make sure the column SCORERESULTS is of type XML.

If the column is not of type XML use the below query

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement