Introduction to XML Data modeling in SQL Server 2005

Source: Internet
Author: User
Tags format file system microsoft sql server sql query

Relational or XML data model

If your data is highly structured and has a known schema, the relational model may be most effective for data storage. Microsoft SQL Server provides the necessary features and tools that you might need. On the other hand, if the structure is flexible (semi-structured and unstructured) or unknown, you must properly consider how to model such data.

If you need a platform-independent model to ensure portability of structured and semantically tagged data, XML is a good choice. Also, if some of the following properties are true, it is an appropriate choice:

• Your data is sparse, or you do not understand the structure of the data, or the structure of the data may change significantly in the future.

• Your data represents the container hierarchy (as opposed to references in the entity) and may be recursive.

• Your data is in an intrinsic order.

• You want to query the data or update some of the data based on its structure.

If either of these conditions is not met, you should use the relational data model. For example, if your data is in XML format, but your application rarely uses a database to store and retrieve data, the [N]varchar (max) column meets all your needs. Storing data in an XML column can provide additional benefits-the engine checks the data format specification or is valid, and supports fine-grained querying and updating of XML data.

Reasons to store XML data in SQL Server 2005

Here are some reasons to use native XML functionality in SQL Server 2005 instead of managing XML data in a file system:

• You want to use the management capabilities of the database server to manage XML data (for example, backup, recovery, and Replication).

• You want to share, query, and modify XML data in an efficient manner and in transaction processing. Fine-grained data access is important for your application. For example, you might want to extract some sections within an XML document, or you might want to insert a new section instead of replacing the entire document.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.