Subscribe To

Subscribe to SQL Server and XML by Email

Sunday, October 19, 2008

SQL Server XML Tutorials

I had been trying to help many people with SQL Server XML related questions in various forums and UG meetings and heard a lot of questions repeatedly coming up from different people. I have a few other tutorials in this web site that discuss various SQL Server XML related topics. I am trying to build one more set of tutorials that tries to answer some of the most common XML processing questions.

Based upon the questions I hear from people, I think there are 4 major XML processing requirements people usually have.

  1. Read values using XQuery from an XML document having a specific structure
  2. Create an XSD Schema for an XML document having a specific structure
  3. Generate an XML document having a specific structure, taking data from one or more tables
  4. Load data from an XML document having a specific structure, into one or more tables

Note that I have highlighted  "specific structure". I talked to many people in the past who know how to perform one or more of the above operations with XML documents having a certain structure. But they find it difficult when the XML structure changes. Some people can read values from attributes, but they find it hard when the values are presented in elements. Or people can easily load data using XML Bulk Load when there are two levels of XML hierarchy, but find it hard when the structure become more complicated.

So the structure of the XML is very important. This set of tutorials aims at helping people who need help to handle XML documents with different structures. I hope this tutorial will help them to  be able to process XML documents with ANY structure.

How does this Tutorial Work?

What I am trying to do in this tutorial is to present the same data in different XML structures. I have created an XML document that contains the information of a Sales Order. So far I have created 20 different representation of the same data, that results in 20 different XML documents having different structure. Then we will perform all the 4 action mentioned above, on those different XML documents. We will read information from all those documents using XQuery, Load the data to one or more Tables, create XSD schemas for those documents and see how to generate documents with different structures using FOR XML.

Tutorials in this series

  1. SQL Server XML Tutorials - Sample XML Documents
  2. SQL Server XML Tutorials - XQuery Tutorials
  3. SQL Server XML Tutorials - XSD Tutorials (coming soon)
  4. SQL Server XML Tutorials - FOR XML Tutorials (coming soon)
  5. SQL Server XML Tutorials - XML Bulk Load Tutorials (coming soon)

Other SQL Server XML Tutorials

  1. XQuery Labs - A Collection of XQuery Sample Scripts
  2. SQLXML Labs - A collection of SQLXML Sample Scripts



Post a Comment

About Me
Jacob Sebastian
* XQuery Tutorials
My Links
SQL Server White Papers
SQL Server 2008
My Articles
XML Workshop RSS Feed
Contact me
Free Hit Counter
Web Site Hit Counters
SQL Server Bloggers
Blog Directories
blogarama - the blog directory Programming Blogs - BlogCatalog Blog Directory
Copyright Jacob Sebastian