I have a table filled with XML Data that I am trying to parse. The XML contains multiple columns of data that I am trying to parse. In some cases there are multiple rows of XML data stuffed into the single column of data and in some cases just one. sample data below:
<REC><C1>0E5627DF-DBB1-4300-40F2-715A8C96190B</C1><C2>apples</C2></REC>
<REC><C1>59868DA4-DB9D-1384-B07D-715A8C96197B</C1><C2>oranges</C2></REC><REC><C1>59868DA4-DB9D-1384-B07D-715A8C96197B</C1><C2>grapes</C2></REC><REC><C1>59868DA4-DB9D-1384-B07D-715A8C96197B</C1><C2>apples</C2></REC>
<REC><C1>7FB8C203-DB30-5340-B07D-715A8C9619FA</C1><C2>bananas</C2></REC><REC><C1>7FB8C203-DB30-5340-B07D-715A8C9619FA</C1><C2>watermelon</C2></REC><REC><C1>7FB8C203-DB30-5340-B07D-715A8C9619FA</C1><C2>limes</C2></REC>
<REC><C1>38B13BFB-DBAA-C340-40F2-715A8C961942</C1><C2>apples</C2></REC>
<REC><C1>58209738-DB3C-DB00-D01A-7FDA8C9619B5</C1><C2>pears</C2></REC><REC><C1>58209738-DB3C-DB00-D01A-7FDA8C9619B5</C1><C2>limes</C2></REC>
What I am trying to do is parse the data into the following 2 column layout
C1 C2
0E5627DF-DBB1-4300-40F2-715A8C96190B apples
59868DA4-DB9D-1384-B07D-715A8C96197B oranges
59868DA4-DB9D-1384-B07D-715A8C96197B grapes
59868DA4-DB9D-1384-B07D-715A8C96197B apples
7FB8C203-DB30-5340-B07D-715A8C9619FA bananas
7FB8C203-DB30-5340-B07D-715A8C9619FA watermelon
7FB8C203-DB30-5340-B07D-715A8C9619FA limes
38B13BFB-DBAA-C340-40F2-715A8C961942 apples
58209738-DB3C-DB00-D01A-7FDA8C9619B5 pears
58209738-DB3C-DB00-D01A-7FDA8C9619B5 limes
Below is my attempt at it:
SELECT Split.XMLD.value('.', 'VARCHAR(500)')
FROM myTable XMLD
CROSS APPLY XMLD.REC.nodes ('/REC') AS Split(XMLD)
Any ideas how to parse this?
Clarification: I want to stay with Native MS SQL SQL here. I don't want to use any third party tools.