Search and Find
Service
Contents at a Glance
5
Contents
6
Foreword
13
About the Author
15
About the Technical Reviewer
16
Acknowledgments
17
Introduction
18
Who This Book Is For
18
How This Book Is Structured
19
Conventions
22
Prerequisites
23
Downloading the Code
23
Contacting the Author
23
Enter XML
24
Looking Back at SQL Server XML
24
What Is XML?
25
Defining XML Data
27
Considering Other Formats
31
When to Use XML
34
What’s New in SQL Server 2008 XML
36
Summary
39
FOR XML and Legacy XML Support
40
Using the FOR XML Clause
40
Using XPath Node Tests
60
Adding Namespaces to FOR XML
68
Creating Complex FOR XML Queries
70
OPENXML Rowset Provider
77
OPENROWSET XML Loading
81
Summary
82
The xml Data Type
83
Creating xml Instances
83
Creating Well-Formed and Valid XML
87
Using XML Type Methods
93
Summary
103
XML Schema Collections
104
Introducing XML Schema
104
Constraining Occurrences
116
Extending XML Schemas with Wildcards
123
Typing XML
129
Summary
135
XQuery
136
Introducing the XQuery Language
136
Creating XQuery Queries
140
Using FLWOR Expressions
154
Constructing XML with XQuery
157
Using the SQL Server xml Methods
160
Maximizing XQuery Performance
168
Summary
172
XQuery Functions and Operators and XML DML
173
Using Operators
174
Using XQuery Type Expressions
176
Using XQuery Functions
178
Modifying XML with XML DML
191
Summary
196
Indexing XML
197
Creating a Primary XML Index
197
Creating Secondary XML Indexes
201
Full-Text Indexing XML
209
Summary
212
XSLT and the SQLCLR
213
Transforming XML
213
Performing a Back-End Transformation
228
Advanced XSL Transformations
239
Summary
248
HTTP SOAP Endpoints
250
Creating Endpoints
251
Consuming Endpoints
259
Summary
263
.NET XML Support
264
XML Validation
264
Accessing XML on the Web
272
REST Services
275
.NET XML Classes
280
Summary
293
Spatial Data and GML
294
Spatial Data
294
Populating Spatial Data
295
GML
299
Summary
312
SQLXML
313
Querying
313
Updategrams
316
Bulk Loading
328
Querying SQLXML with XPath
332
Summary
335
LINQ to XML
336
Functional Construction
336
Loading XML from Other Sources
338
Querying XML
347
Transforming XML
354
Summary
356
XML Support Tools
357
Bulk Copy Program
357
XML for Analysis
359
SQL Server Integration Services
361
XML Query Plans
363
Database Tuning Advisor
365
XMLSpy
366
Web Browsers
368
Visual Studio
370
Summary
370
W3C and Other References
372
W3C Specifications
372
Other Useful Documents
374
SQL Server XQuery Data Types
376
XML Schema Reference
380
Element Information Items
380
XML Schema Data Type Facets
387
XQuery/XPath/XML DML Quick Reference
389
XPath
389
XQuery
391
XML DML
394
XSLT 1.0 and XPath 1.0 Reference
395
Glossary
402
Selected T-SQL and .NET Code Listings
414
Chapter 1
414
Chapter 2
415
Chapter 3
422
Chapter 4
428
Chapter 5
433
Chapter 6
437
Chapter 7
438
Chapter 8
440
Chapter 9
445
Chapter 10
448
Chapter 11
451
Chapter 12
452
Index
459
All prices incl. VAT