Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In Chapter 1, “SQL, XML, and the Business Internet,” I described the use of XML in business integration solutions and the relationship between relational data and XML documents. Now let’s turn our attention to extracting data from Microsoft SQL Server 2000 in XML format.
Most database application developers are accustomed to retrieving large sets of data from a database server in a rowset format, such as a Microsoft ActiveX Data Objects (ADO) recordset or a Microsoft ADO.NET DataReader object. In a typical application, a SQL SELECT statement is used to select rows from one or more tables in the database and return those rows to the client for processing. SQL Server 2000 extends the SELECT statement to enable the retrieval of data as XML.