17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 16: A Brief XML Primer<br />

The final result set from this looks just like what we wanted:<br />

ShipperID ShipperName DateInSystem<br />

----------- ------------------------------ -----------------------<br />

1 United Parcel Service <strong>2008</strong>-11-05 18:51:42.673<br />

(1 row(s) affected)<br />

ShipperID CompanyName<br />

----------- ----------------------------------------<br />

100 Billy Bob's Great Shipping<br />

101 Fred's Freight<br />

(2 row(s) affected)<br />

(2 row(s) affected)<br />

ShipperID ShipperName DateInSystem<br />

----------- ------------------------------ -----------------------<br />

1 United Parcel Service <strong>2008</strong>-11-05 18:51:42.673<br />

100 Billy Bob's Great Shipping <strong>2008</strong>-11-09 20:56:29.177<br />

101 Fred's Freight <strong>2008</strong>-11-09 20:56:29.177<br />

(3 row(s) affected)<br />

We now have one more way to get XML query results, and a way to get XML turned into relational data.<br />

Keep in mind that OPENXML has other parameters and features for you to explore as you continue on<br />

your <strong>SQL</strong> <strong>Server</strong> journey.<br />

A Brief Word on XSLT<br />

514<br />

Well now, this takes us to the last, but far and away the most complex of the things we’re dealing with in<br />

this chapter. The Extensible Stylesheet Language Transformations side of things is something of a little<br />

extra toss into the XML world that increases the power of XML multifold. You see, using XSLT, we can<br />

transform our XML document into other forms.<br />

To get us going on a quick start here, let’s take a look at an XML document produced from <strong>Microsoft</strong>’s<br />

old Northwind database example:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!