Chapter 16

A Brief XML Primer

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • The nature of XML
  • How an XML document is structured
  • Well formed and valid XML
  • How SQL Server deals with XML
  • Methods used to retrieve and modify data within XML documents in SQL Server
  • How to retrieve relational data in XML format

So, here you are — most of the structural stuff is done at this point, so you’re ready to start moving on to the peripheral stuff. That is, you’re ready to start looking at things that are outside of what one usually actively thinks of when working with relational database systems. It’s not that some of the items you still have to cover aren’t things that you would normally expect out of a relational database system — it’s just that you don’t really need these in order to have a functional SQL Server. Indeed, there are so many things included in SQL Server now, that it’s difficult to squeeze everything into one book.

This chapter starts by presenting some background for what has become an increasingly integral part of SQL Server — XML. It then moves on to looking at some of the many features SQL Server has to support XML. The catch here is that XML is entirely its own animal — it’s a completely different kind of thing than the relational system you’ve been working with up to this point. Why then does SQL Server include so much functionality to support it? The short answer is that XML is probably the most important thing to happen to data since the advent of data warehousing.

XML has ...

Get Beginning Microsoft® SQL Server® 2012 Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.