Chapter 13. XML and SQL Server: HTTP Queries

for RuBoard

Generally, he who occupies the field of battle first and waits his enemy is at ease; he who comes later to the scene and rushes into the fight is weary.

Sun Tzu [1]

[1] Tzu, Sun. The Art of War . Cambridge, England: Oxford University Press, 1963. Page 96.

As I mentioned in the previous chapter, XML is taking over the world. Someday it will probably even supplant HTML as the most widely used markup language on the Internet. So it's no surprise that SQL Server has built-in support for working with XML. Like most modern DBMSs, SQL Server regularly needs to work with and store data that may have originated in an XML document. Without this built-in support, getting XML to and from SQL Server would require the application developer to translate XML data before sending it to SQL Server and again after receiving it back. Obviously, this could quickly become very tedious , given the ubiquity and growing popularity of the language.

SQL Server is an XML-enabled database. This means that it can read and write XML data. It can return data from databases in XML format, and it can read and update data stored in XML documents. As Table 13-1 illustrates, out of the box, SQL Server's XML features can be broken down into four general categories. (The beta version of SQL-XML Web Release 1 promises to add to this list. See the section titled "Web Release 1" at the end of Chapter 15 for more information.)

Table 13-1. SQL Server's XML Features
Feature Purpose
FOR XML An extension to the SELECT command that allows result sets to be returned as XML
OPENXML() Allows reading and writing of data in XML documents
XPath queries Allows SQL Server databases to be queried using XPath syntax
XDR schemas Supports XDR schemas and XPath queries against them
for RuBoard


The Guru[ap]s Guide to SQL Server[tm] Stored Procedures, XML, and HTML
The Guru[ap]s Guide to SQL Server[tm] Stored Procedures, XML, and HTML
ISBN: 201700468
EAN: N/A
Year: 2005
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net