This chapter introduced many different ways that SQL Server 2000 provides XML support, both out-of-the box and through the SQLXML 3.0 add-on.
A convenient tool that SQL Server provides is the FOR XML clause to retrieve data from the database as XML. This provides many possibilities, including the ability to generate web reports quickly by combining SQL Server's generated XML with XSLT stylesheets.
Querying SQL Server over the web has traditionally required custom software to be written to act as a broker between the client and database. SQL Server 2000 also significantly reduces the amount of code necessary to provide data over the web through virtual directories. Within virtual directories, virtual names can be associated for different types of objects: database objects, schemas, and templates.
Template files provide a mechanism to store queries and XPath statements so they may be executed multiple times. By providing only template files and not allowing direct access to the database, you are able to reduce the risk of exposing data directly over the web.
Schemas also play an important role in SQL Server's XML strategy. Special annotations within the schemas create XML views of data on the server. These views are used to map XPath queries, Diffgrams, and Updategrams to the physical data locations on the database.