I have the table: TestXml with 2 columns(pk , xCol). This is my table:
create table TestXml (
pk int primary key, xCol xml)
on [Primary]
insert into Store.dbo.TestXml(pk,xCol) values (1,'<docs><doc id="12"><section> Section 1</section></doc>
<doc id="123"><section> Section 1</section>
<section> Section 2</section>
</doc>
</docs>'
)
the xml value , that I was insert looks like this:
<docs>
<doc id="12">
<section> Section 1</section>
</doc>
<doc id="123">
<section> Section 1</section>
<section> Section 2</section>
</doc>
</docs>
How can I take "<section>
" element where "<doc id = "123">
" ?