XML Support in SQL Server 2000
SQL Server 2000 is a new .NET Enterprise Server designed to provide a data backend to other .NET Enterprise Servers and .NET applications. XML plays an important role in this strategy.
You can use XML in SQL Server 2000 in the following ways:
Retrieve SQL Server data in XML format using the new FOR XML Transact-SQL extension. This format is convenient when you need to integrate this data with Active Server Pages.
Open XML data from Transact-SQL as a result set using the new OPENXML function.
Access SQL Server 2000 through the Internet using a HTTP connection.
Use the improved OLEDB SQL Server Provider and ADO database library with extended XML support to send XML queries and receive XML results using the new Stream object.
Use XML Updategrams to insert, delete, or update SQL Server data.
Use the XML Bulk Loader Component to import XML data into SQL Server 2000. This feature is not covered in this chapter. To learn how to use this new feature, you can look at the documentation installed as part of the "SQL Server XML and Internet Support-Web Release 1" component.
This XML support facilitates the use of SQL Server 2000 on the Internet and its integration with other .NET Enterprise Servers, such as Microsoft Biztalk Server 2000.
HTTP access to SQL Server is provided by a Internet Information Server extension (SQLISAPI.DLL) through a specially defined virtual server.
The SQLOLEDB provider is enhanced to provide different services:
XML Template translation into SELECT... FOR XML statements
XPath queries translation into SELECT... FOR XML statements
XML Updategram translation into the corresponding INSERT, DELETE, or UPDATE Transact-SQL statements.
In the following sections you learn how to use these new features. As mentioned earlier, this is just an introduction to this extremely vast technology. The examples contained in this chapter are intended to guide you through the beginning stages of this XML adventure.