Interactive SQL Server & XML Online Tutorial

Interactive SQL Server & XML Online TutorialMotorway ramps. City streets. Country roads. Wherever you are in a Mazda2, it’s all about fun. The fun that comes from a car that’s responsive and nimble. A car with a healthy dose of sporty attitude. Standard or Sport, whichever model you choose, the fresh style, insightful engineering and spirited performance of Mazda2 is bound to put a smile on your face. And some Zoom-Zoom in your life.

Introduction
With the release of SQL Server 2000, a lot more support and functionality for XML was included in the product. Some of this functionality includes accessing SQL Server using HTTP and new OLAP services (now called Analysis Services). But the majority of the new functionality focuses on supporting XML. This new functionality includes the ability to read and write XML data, support for XDR schemas, and XPath This tutorial will show you the different methods of retrieving XML from SQL Server, how to control how the data is returned, and then discuss how to navigate through the returned results. You will also learn ways of viewing SQL Server tables from an XML perspective. From there you’ll learn how to load data into SQL Server using XML natively, including real-time over HTTP. Most of the topics covered today are straight out of the box functionality. However, a couple of things are not. Functionality such as Updategrams and XML Bulk Load require an extra installation. This file, XML for SQL Server Web Release 1, is included with this tutorial (or it can also be downloaded from the Microsoft website). Later on in the tutorial when we discuss Updategrams and Bulk Load we will also walk through the installation of this file.
For XML
New with SQL Server 2000 is the ability to return the results of a query in XML format. This is accomplished by adding the FOR XML clause at the end of the SELECT statement. It is not difficult to use, and the syntax is as follows:
FOR XML mode [, XMLDATA] [, ELEMENTS] [, BINARY BASE 64]
The arguments in brackets are optional, but definitions of all the arguments are:
- mode - this is the only required argument. It specifies how the XML will be returned in the result set. There are 3 values that can be used:
o AUTO - returns query results as nested XML elements.
o EXPLICIT - you specify the format of the results.
o RAW - each row is returned as an XML element
- XMLDATA - when specified, the schema is returned along with the results.
- ELEMENTS - this argument can only be used in conjunction when mode is AUTO. The query results are returned as XML sub-elements.
- BINARY BASE64 - if the resultset being returned will contain binary data then this attribute specifies what form the results will look like. The binary data is returned as BASE 64.

Website: www.proinf.net | Filesize: 332kb
No of Page(s): 44
Click here to download Interactive SQL Server & XML Online Tutorial.

Related Tutorial

Tags: , , ,

Comments

Leave a Reply