Wednesday, July 7, 2010

XML and SQL server

Let me start this off by saying that I don’t fully understand XML and how it interacts with SQL server 2005 and 2008. I don’t think I am alone here. I have heard nice buzz words like XQuery, XPath, XSLT but I did not know how the pieces fit together. Hopefully I can help make things a little clearer.

1) what is XQuery? XQuery is a query system for XML documents. Basically the SQL for XML documents. Similarly to XSLT, but XSLT is primarily designed to transform XML into HTML. XQuery gives a user the ability to Query XML documents for certain bits of data. The most Current Version of XQuery is 1.0.
XPath is a subset or of XQuery and XSLT.

2) What is XPath? first appeared in 1999. There are two versions that are in use today. version 1.0 was accepted in 1999 and is still the most widely used version. Version 2.0 became official in 2007.

3) What does all this do in SQL server? As you may know from working with SQL server 2005 there is a new data type called XML. Before and still you can save XML documents as text or varchar. There is one distinct advantage to simply saving XML as text, and that is you can Query it. The tool that you use to navigate the XML data type is XQuery. Hope this clears up some confusion that you may have about these concepts.

No comments:

Post a Comment