I have this XML in a SQL Server table:
<root>
<meetings>
<meeting>
<id>111</id>
<participants>
<participant><name>Smith</name></participant>
<participant><name>Jones</name></participant>
<participant><name>Brown</name></participant>
</participants>
</meeting>
<meeting>
<id>222</id>
<participants>
<participant><name>White</name></participant>
<participant><name>Bloggs</name></participant>
<participant><name>McDonald</name></participant>
</participants>
</meeting>
</meetings>
</root>
And want a result set like this:
MeetingID Name
111 Smith
111 Jones
111 Brown
222 White
222 Bloggs
222 McDonald
This is easy using select from openxml
but I failed using XQuery. Can someone help me there, and maybe also give pros and cons for either method?