Tuesday, June 29, 2004

XML Developer Center: XML and the Database: XML to SQL: Using SQLXML Bulkload in .NET Framework

Amar Nalla showcases the Bulkload functionality available in SQLXML, which can be used to transform XML input into SQL data by building a .NET Framework-based application that shreds RSS feed data into a database.

XML has become the industry-wide standard for exchanging data across business systems. At the same time, the use of a relational backend as the data-store is well established. As developers, we are sometimes faced with the task of exposing existing relational data as XML to share it across multiple systems, or we are required to take input XML and shred the data into a relational database. Microsoft SQL Server 2000 has excellent built in support to achieve both tasks. In addition to the support inside the server, SQL Server 2000 has XML support at the middle-tier that can be used to perform the above tasks. The middle-tier based solution is enabled by using SQLXML. SQLXML 3.0, which is the current released version, is an add-on product that can be used along with SQL Server to enable extensive XML features. For an overview of the XML features provided by SQL Server 2000 and SQLXML, read Andrew Conrad's Survey of SQL Server 2000's XML Features.

Note This column is based on the SQL Server XML functionality that is available in SQLXML 3.0 SP2. It is the third major release in the SQLXML web release series. SQLXML periodically adds new XML functionality to SQL Server 2000, to keep pace with the fast changing world of XML and in response to customer requests. To download the latest Web release, or to find more information on the new features offered in the XML for SQL Server Web Releases, see the SQLXML Developer Center.
This article takes an in-depth look at the SQLXML Bulkload functionality, by building an application that takes an input XML stream and shreds the information into SQL Server relational tables. This article also tries to answer some of the common questions that arise when using Bulkload in an enterprise application. Specifically, the article cover the following:

Transforming a complex hierarchy of XML into a single table.
Using Bulkload in a .NET application.
Using Streams as input data mechanism for Bulkload in .NET

No comments: