For those of you who have been living in a cave for the past ten years and haven’t heard the hype surrounding XML, it stands for eXtensible Markup Language. XML allows you to structure your data using a standardized schema. The standardization is the most important part, since that is the power of XML. Any other system can read or write data that adheres to the standard, with the usual caveats that different systems may interpret the data differently sometimes. XML also provides the ability for retrieving certain values from the XML using the XML Path Language (XPath) standard and transforming your XML using XML Stylesheet Language Transformations (XSLT). You’ll learn about XPath later in this chapter and XSLT in the next chapter.
One interesting discussion is deciding between XML and relational data. A lot of debate goes back and forth between the value of storing your data in a purely relational model, a hybrid XML/relational model, or a purely XML model. In our opinion, do whatever makes the most sense to the problem you are solving. If your expertise is in relational technology and you are getting great performance from your relational data, there is no need to switch to XML-based storage. You can easily expose your relational data as XML to the outside world, using FOR XML statements, and you can continue to store your data internally as relational data. Don’t fall prey to XML’s siren song without good reason to move to it. For example, XML is text based, so it is bigger than its binary equivalents. XML is verbose since it isn’t normalized like relational data, so you may have repeating sections of the same data in a single XMLdocument. Finally, XML has a different programming model than what a relational programmer is used to using.
Let’s start with some basic XML terminology. You’ll hear many people refer to documents, elements, and attributes. The easiest way to think about this is that an entire XML structure is the document, the document contains elements, and elements can contain attributes. The sample XML document here contains one document, three elements, and two attributes:<?xml version="1.0"?>
XML has schemas and namespaces. You are not required to put schemas on your XML, but schemas and namespaces help to uniquely define what is valid or invalid structure and data in your XML document. In the relational world, we have our table structures and constraints. You can map some of your relational concepts to XML schemas since XML schemas have datatypes and rules that control order, cardinality, and other aspects of the XML document. Schemas allow you to share your XML data with others but still have the other people understand your XML. An XML namespace is a collection of names, identified by a URI reference, that your element types and attribute names use in an XML document. Namespaces allow you to use the same names from different sources and avoid name collisions. For example, you can use the same element called customer from two different sources if you add namespaces that identify the elements as belonging to different namespaces. Schemas and namespaces will be important when we discuss the XML datatype in SQL Server and storing your XML natively in the database.
SQL Server 2008 Related Interview Questions
|SQL Server 2000 Interview Questions||MSBI Interview Questions|
|SQL Server 2008 Interview Questions||SQL Server 2005 Interview Questions|
|SSIS(SQL Server Integration Services) Interview Questions||SSRS(SQL Server Reporting Services) Interview Questions|
|Microsoft Entity Framework Interview Questions||LINQ Interview Questions|
|SQL Server Analysis Services (SSAS) Interview Questions||Sql Server Dba Interview Questions|
SQL Server 2008 Related Practice Tests
|SQL Server 2000 Practice Tests||MSBI Practice Tests|
|SQL Server 2008 Practice Tests||SQL Server 2005 Practice Tests|
|SSIS(SQL Server Integration Services) Practice Tests||SSRS(SQL Server Reporting Services) Practice Tests|
|Microsoft Entity Framework Practice Tests||LINQ Practice Tests|
Sql Server 2008 Tutorial
Sql Server 2008 Overview
Sql Server Installation And Configuration
Sql Server Encryption
Automation And Monitoring
Integrated Full-text Search
New Datatypes In Sql Server 2008
T-sql Enhancements For Developers
T-sql Enhancements For Dbas
Sql Server And Xml
Sql Server Xml And Xquery Support
Linq To Sql
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.