Querying xml data with SQL
- From: "Cathy" <cathywigzell@xxxxxxxxxxx>
- Date: 15 Jan 2007 03:03:12 -0800
I have a table in Microsoft SQL Server 2005 with column of datatype
xml. The xml may contain multiple elements of the same type, e.g.
multiple <child> elements for a single <parent>. How can I query on the
<child> elements?
For example, what would be the correct syntax for this query where both
parent and child are elements within the xml...
SELECT parent FROM MY_XML_TABLE WHERE child='A' OR child='B'
I've already had a play around with xml.value and xml.nodes - but I
think I'm missing something crucial!
Many thanks for your help,
Cathy
.
- Follow-Ups:
- Re: Querying xml data with SQL
- From: Denis Ruckebusch [MSFT]
- Re: Querying xml data with SQL
- Prev by Date: RE: Thoughts on storing address data with XML data type?
- Next by Date: SQLXML Import Schema - must complexTypes always create separate ta
- Previous by thread: Re: Well Formed XML not returned using FOR XML (<?xml version="1.0"?>)
- Next by thread: Re: Querying xml data with SQL
- Index(es):
Relevant Pages
|