Query from 2 XML data sources



Hi,

Suppose I have to XML documents. The first one contains a list of
authors and the second one contains a list of books. For example,

author.xml
--------------------------
<authors>
<author @id="1">
<name>Tom</name>
<tel>001-909-1129</tel>
</author>
<author @id="2">
<name>Chris</name>
<tel>001-871-1341</tel>
</author>
<author @id="3">
<name>Jack</name>
<tel>001-452-8721</tel>
</author>
</authors>

book.xml
--------------------------
<catalog>
<book>
<title>SQL Server for Dummies</title>
<author @id="1">Tom</author>
</book>
<book>
<title>XQuery for Dummies</title>
<author @id="2">Chris</author>
</book>
<book>
<title>It's All About XML</title>
<author @id="3">Jack</author>
</book>
</catalog>

Suppose I store "author.xml" as xml data type in the AUTHOR table and
"book.xml" as xml data type in the BOOK table. I would like to get the
information of authors who have written a book with title containing
"XQuery".

How can I write XQuery in SQL Server 2005 ?

Thanks
.



Relevant Pages

  • Passing XML data type to a SQL Server 2005 procedure (BizTalk 2006)
    ... I'm using a stored procedure in SQL Server 2005 that can receive a XML ... parameter (with the new XML data type available with SQL Server 2005). ... The SQL adapter wizard generates a schema to make the request to the ... I would like to map a entire schema into that attribute but couldn't ...
    (microsoft.public.biztalk.general)
  • Re: Aggregate on XML Data Type
    ... Columnist, SQL Server Professional ... Toronto, ON Canada ... Is there a way to aggreate data on the XML data type? ...
    (microsoft.public.sqlserver.xml)
  • Re: reading xml from database..
    ... #XML Data Type Support in ADO.NET 2.0: Handling XML from SQL Server 2005 ... #XML Data type in ADO.Net v2.0 - Part II ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Parsing large XML files?
    ... I get the following message when I try to execute the first query. ... create table dbo.xmlDocs(pkid smallint identity(-32767,1) primary ... I thought you were using SQL Server 2005 where we have the XML data type. ...
    (microsoft.public.sqlserver.xml)
  • Re: XML support in 2005?
    ... for functionality to be the primary concern during betas, ... Wayne Snyder, MCDBA, SQL Server MVP ... community of SQL Server professionals. ... > I've tested SQL 2005 Beta 2's XML data type support and I've concluded ...
    (microsoft.public.sqlserver.server)

Loading