Chapter 8. XML and Databases

Most likely, the majority of today’s computer experts and students would associate the idea of a database with a relational database. Since their introduction in the early 1970s, relational databases have gained an extraordinary success. Relational databases have grown so steadily and progressively that along the way they’ve lost the qualifying adjective relational and become the only commonly accepted way to design a database.

Today, relational databases like Microsoft SQL Server 2000, Oracle 9i, and IBM DB2 are the favorite tools for storing and working with data. Modern databases do a lot of things, but what a (relational) database still does best is store data. Relational databases won out over other data models such as the hierarchical and reticular models mostly because of their inherent simplicity and natural way of modeling data and arranging queries. Relational databases exploit the structured query language (SQL) to search for contained information.

Recent developments in the computer industry have raised the need for total software integration and communication. As a side effect, data modeled into a system must often be transformed into analogous, but not identical, models in order to be stored or linked on different systems. Enter XML and its innate ability to describe data.

More and more often today you need to extract data out of databases and model it into a particular data schema using XML. So why not just ask the database itself to return data as XML, possibly formatted in a supplied schema? XML support is built into (or will be built into) almost all database management systems (DBMS) currently available. In particular, Microsoft SQL Server 2000 comes with an embedded engine capable of returning data as XML. This feature is built as an extension to the traditional SELECT command, and data is rendered as XML before being sent back to the client. Oracle 9i provides a slightly different model that treats XML as a native data type. XML data can be stored in ad hoc relational tables as well as in binary large object (BLOB) fields that can be either binary or ASCII.

Whatever the vendor approach, XML and databases represent a key alliance for the present and the future of data-driven and interoperable applications. In this chapter, we’ll review the essential aspects of XML in SQL Server 2000, and you’ll learn how to take advantage of these features from within a Microsoft .NET Framework environment.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.8.127