I need help in retrieving the data from this XML that is stored in a column in a SQL Server table. I've been searching the questions repository but couldn't find any that matches mine. Maybe i missed out somehow. Anyway, here how the stored XML looks like :
<ProductStructure>
<Plans>Essential</Plans>
<Plans>Standard</Plans>
<Plans>Silver</Plans>
<Plans>Gold</Plans>
<Plans>Platinum</Plans>
<Plans>Titanium</Plans>
<Destinations>Region A</Destinations>
<Destinations>Region B</Destinations>
<Destinations>Region C</Destinations>
<Destinations>Region D</Destinations>
<InsuredTypes>One Person</InsuredTypes>
<InsuredTypes>Couple</InsuredTypes>
<InsuredTypes>Group</InsuredTypes>
</ProductStructure>
I would like to select the xml and get an output like below in SQL:
|Plans |Essential |
| |Standard |
| |Silver |
| |Gold |
| |Platinum |
| |Titanium |
|---------------+-------------|
|Destinations |Region A |
| |Region B |
| |Region C |
| |Region D |
|---------------+-------------|
|InsuredTypes |One Person |
| |Couple |
| |Group |
Sorry for if the question was visualized badly. Thank you.