SlideShare a Scribd company logo
Polish SQL Server User Group
Querying and Managing XML Data
CHAPTER 7
Polish SQL Server User Group
About the Author
Marek Maśko
• Principal Database Analyst at Sabre
• Working with SQL Server for ~7 years
• SQL DBA, Dev & Architect
• MCP since 2012
• Contact Information:
Email: marek.masko@gmail.com
LinkedIn: https://pl.linkedin.com/in/marekmasko
Twitter: @MarekMasko
Polish SQL Server User Group
Agenda
• XML Introduction
• Returning Results As XML with FOR XML
• Querying XML Data with XQuery
• Using the XML Data Type
Polish SQL Server User Group
XML INTRODUCTION
Polish SQL Server User Group
Basic Example
Polish SQL Server User Group
Terminology
• A tag is a markup construct that begins with < and
ends with >. Tags come in three flavors:
start-tag, such as <section>;
end-tag, such as </section>;
empty-element tag, such as <line-break />.
Polish SQL Server User Group
Terminology
• An element is a logical document component that
either begins with a start-tag and ends with a
matching end-tag or consists only of an empty-
element tag. The characters between the start-tag
and end-tag, if any, are the element's content.
<greeting>Hello, world!</greeting>;
<line-break />.
Polish SQL Server User Group
Terminology
• An attribute is a markup construct consisting of a
name–value pair that exists within a start-tag or
empty-element tag.
<img src="madonna.jpg" alt="Madonna" />;
<step number="3">Connect A to B.</step>.
• An XML attribute can only have a single value and
each attribute can appear at most once on each
element.
Polish SQL Server User Group
Basic Example
Polish SQL Server User Group
XML
• Well-formed
• Ordered
• Case-sensitive Unicode
• Character data section
<![CDATA[ … ]]>
• Prolog
<?xml version="1.0" encoding="ISO-8859-15"?>
• XML Document vs XML Fragments
Polish SQL Server User Group
XML Namespace
Polish SQL Server User Group
XML Schema
• Standard to describe the metadata of XML
documents
• XML Schema Description (XSD) document
• Document validation
• Typed XML
Polish SQL Server User Group
RETURNING RESULTS AS XML
WITH FOR XML
Lesson 01
Polish SQL Server User Group
FOR XML clause
• Four modes:
–RAW
–AUTO
–PATH
–EXPLICIT
Polish SQL Server User Group
LESSON REVIEW
Polish SQL Server User Group
Question 1
• Which FOR XML options are valid? (Choose all that
apply.)
A. FOR XML AUTO
B. FOR XML MANUAL
C. FOR XML DOCUMENT
D. FOR XML PATH
Polish SQL Server User Group
Question 2
• Which directive of the FOR XML clause should you
use to produce element-centric XML?
A. ATTRIBUTES
B. ROOT
C. ELEMENTS
D. XMLSCHEMA
Polish SQL Server User Group
Question 3
• Which FOR XML options can you use to manually
format the XML returned? (Choose all that apply.)
A. FOR XML AUTO
B. FOR XML EXPLICIT
C. FOR XML RAW
D. FOR XML PATH
Polish SQL Server User Group
QUERYING XML DATA WITH XQUERY
Lesson 02
Polish SQL Server User Group
XQuery
• The standard language for browsing XML instances and
returning XML.
• XQuery is, like XML, case sensitive.
• XQuery returns sequences. Sequences can include atomic
values or complex values (XML nodes).
• Every identifier in XQuery is a qualified name, or a
QName. A QName consists of a local name and,
optionally, a namespace prefix.
• The SQL Server database engine processes XQuery inside
T-SQL statements through XML data type methods.
Polish SQL Server User Group
Sequences
Polish SQL Server User Group
XQuery Functions
• Numeric functions: ceiling(), floor(), round()
• String functions: concat(), contains(), substring(), string-
length(), lower-case(), upper-case()
• Boolean and Boolean constructor functions: not(), true(),
false()
• Nodes functions: local-name(), namespace-uri()
• Aggregate functions: count(), min(), max(), avg(), sum()
• Data accessor functions: data(), string()
• SQL Server extension functions: sql:column(),
sql:variable()
Polish SQL Server User Group
Navigation
• XPath expressions
• Every path consists of a sequence of steps
Node-name/child::element-name[@attribute-name=value]
• Step may consist of three parts:
– Axis Specifies the direction of travel. In the example, the axis is child::,
which specifies child nodes of the node from the previous step.
– Node test Specifies the criterion for selecting nodes. In the example,
element-name is the node test; it selects only nodes named element-
name.
– Predicate Further narrows down the search. In the example, there is
one predicate: [@attribute-name=value], which selects only nodes that
have an attribute named attribute-name with value value, such as
[@orderid=10952].
Polish SQL Server User Group
Axis
Polish SQL Server User Group
Node test
• A node test follows the axis you specify
• Possibilities:
– Simple node name
– Wildcard (*) = any principal node
• Node type tests:
– comment() Allows you to select comment nodes.
– node() True for any kind of node. Do not mix this with the asterisk
(*) wildcard; * means any principal node, whereas node() means
any node at all.
– processing-instruction() Allows you to retrieve a processing
instruction node.
– text() Allows you to retrieve text nodes, or nodes without tags.
Polish SQL Server User Group
Predicates
• Numeric – select nodes by position:
–/x/y[1]
–(/x/y)[1]
• Boolean – select nodes for which the predicate
evaluates to true
Polish SQL Server User Group
Value comparison operators
Polish SQL Server User Group
IF..THEN..ELSE
if (<expression1>)
then
<expression2>
else
<expression3>
• Like T-SQL CASE expression
Polish SQL Server User Group
FLWOR Expressions
• FOR - bind iterator variables to input sequences
• LET - assign a value to a variable for a specific
iteration
• WHERE - filter the iteration
• ORDER BY - control the order based on atomic values
• RETURN - format the resulting XML
Polish SQL Server User Group
LESSON REVIEW
Polish SQL Server User Group
Question 1
• Which of the following is not a FLWOR clause?
A. for
B. let
C. where
D. over
E. return
Polish SQL Server User Group
Question 2
• Which node type test can be used to retrieve all
nodes of an XML instance?
A. Asterisk (*)
B. comment()
C. node()
D. text()
Polish SQL Server User Group
Question 3
• Which conditional expression is supported in XQuery?
A. IIF
B. if..then..else
C. CASE
D. switch
Polish SQL Server User Group
USING THE XML DATA TYPE
Lesson 03
Polish SQL Server User Group
XML Data Type Methods
• query() – support querying
• value() – support retrieving atomic values
• exist() – support checking existence
• modify() – support modifying sections within the
XML data
• nodes() – support shredding XML data into
multiple rows in a result set
Polish SQL Server User Group
Using the XML Data Type for Dynamic Schema
Polish SQL Server User Group
XML Indexes
• XML can be up to 2GB of data
• Primary XML index – shredded persisted
representation of the XML values;
• Three types of Secondary XML indexes:
–PATH
–VALUE
–PROPERTY
Polish SQL Server User Group
LESSON REVIEW
Polish SQL Server User Group
Question 1
• Which of the following is not an XML data type
method?
A. merge()
B. nodes()
C. exist()
D. value()
Polish SQL Server User Group
Question 2
• What kind of XML indexes can you create? (Choose all
that apply.)
A. PRIMARY
B. PATH
C. ATTRIBUTE
D. PRINCIPALNODES
Polish SQL Server User Group
Question 3
• Which XML data type method do you use to shred
XML data to tabular format?
A. modify()
B. nodes()
C. exist()
D. value()
Polish SQL Server User Group
THANK YOU!
Polish SQL Server User Group
Resources
• Book: Training Kit Exam 70-461
• Scripts for Training Kit

More Related Content

What's hot (20)

PPT
Xml 215-presentation
Manish Chaurasia
 
PPTX
Xml dtd
sana mateen
 
PPT
Document Type Definition
yht4ever
 
PPTX
DTD
Kamal Acharya
 
PPTX
XML, DTD & XSD Overview
Pradeep Rapolu
 
PPTX
Fergus Fahey - DRI/ARA(I) Training: Introduction to EAD - Introduction to XML
dri_ireland
 
PPT
XML and DTD
Jussi Pohjolainen
 
PPTX
Extensible Markup Language (XML)
AakankshaR
 
PPTX
Xml dtd
HeenaRajput1
 
PPTX
Introduction to xml
Gtu Booker
 
PPT
Introduction to XML
Bình Trọng Án
 
PPT
2 dtd - validating xml documents
gauravashq
 
PPT
Introduction to XML
BG Java EE Course
 
PPTX
XML's validation - DTD
videde_group
 
Xml 215-presentation
Manish Chaurasia
 
Xml dtd
sana mateen
 
Document Type Definition
yht4ever
 
XML, DTD & XSD Overview
Pradeep Rapolu
 
Fergus Fahey - DRI/ARA(I) Training: Introduction to EAD - Introduction to XML
dri_ireland
 
XML and DTD
Jussi Pohjolainen
 
Extensible Markup Language (XML)
AakankshaR
 
Xml dtd
HeenaRajput1
 
Introduction to xml
Gtu Booker
 
Introduction to XML
Bình Trọng Án
 
2 dtd - validating xml documents
gauravashq
 
Introduction to XML
BG Java EE Course
 
XML's validation - DTD
videde_group
 

Viewers also liked (6)

PPTX
02 troubleshooting essentials sql server profiler - sql pass peru
Guillermo Taylor
 
PPTX
Novedades en el manejo de Grandes volúmenes de datos con SQL Server 2014
Enrique Puig
 
PPTX
MS SQL Server 2014 - In-Memory OLTP
Joseph Lopez
 
PPTX
Simultaneidad impedidos por los bloqueos
Tecnologia y Soluciones Computacionales de Morelos
 
PPTX
Fundamentos sobre los Bloqueos en SQL Server
Kike Puig
 
PPT
INTERBLOQUEOS Y NIVELES DE AISLAMIENTO
juan
 
02 troubleshooting essentials sql server profiler - sql pass peru
Guillermo Taylor
 
Novedades en el manejo de Grandes volúmenes de datos con SQL Server 2014
Enrique Puig
 
MS SQL Server 2014 - In-Memory OLTP
Joseph Lopez
 
Simultaneidad impedidos por los bloqueos
Tecnologia y Soluciones Computacionales de Morelos
 
Fundamentos sobre los Bloqueos en SQL Server
Kike Puig
 
INTERBLOQUEOS Y NIVELES DE AISLAMIENTO
juan
 
Ad

Similar to SQL Server - Querying and Managing XML Data (20)

PPT
Sql2005 Xml
jason hu 金良胡
 
DOCX
Sql server 2008 r2 xml wp
Klaudiia Jacome
 
PPTX
Sql2005 xml
nkaluva
 
PDF
PostgreSQL and XML
Peter Eisentraut
 
PPT
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Marco Gralike
 
PDF
XSD Incomplete Overview Draft
Pedro De Almeida
 
PPTX
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
Marco Gralike
 
PDF
XML Support: Specifications and Development
Peter Eisentraut
 
PPT
Working With XML in IDS Applications
Keshav Murthy
 
PPTX
Xml and databases
Raghu nath
 
PPTX
Xml part4
NOHA AW
 
PPT
DB2 Native XML
Amol Pujari
 
PPS
06 qmds2005 session08
Niit Care
 
PPT
Application development using Microsoft SQL Server 2000
webhostingguy
 
PPT
XMLLec1 (1xML lecturefsfsdfsdfdsfdsfsdfsdfdsf
Kamrankhan925215
 
PPT
XMLLec1.pptsfsfsafasfasdfasfdsadfdsfdf dfdsfds
Kamrankhan925215
 
PPT
XML stands for EXtensible Markup Language
NetajiGandi1
 
PPTX
SQLPASS AD501-M XQuery MRys
Michael Rys
 
PDF
TEST UPLOAD
James Meldrum
 
PPS
01 qmds2005 session01
Niit Care
 
Sql2005 Xml
jason hu 金良胡
 
Sql server 2008 r2 xml wp
Klaudiia Jacome
 
Sql2005 xml
nkaluva
 
PostgreSQL and XML
Peter Eisentraut
 
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Marco Gralike
 
XSD Incomplete Overview Draft
Pedro De Almeida
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
Marco Gralike
 
XML Support: Specifications and Development
Peter Eisentraut
 
Working With XML in IDS Applications
Keshav Murthy
 
Xml and databases
Raghu nath
 
Xml part4
NOHA AW
 
DB2 Native XML
Amol Pujari
 
06 qmds2005 session08
Niit Care
 
Application development using Microsoft SQL Server 2000
webhostingguy
 
XMLLec1 (1xML lecturefsfsdfsdfdsfdsfsdfsdfdsf
Kamrankhan925215
 
XMLLec1.pptsfsfsafasfasdfasfdsadfdsfdf dfdsfds
Kamrankhan925215
 
XML stands for EXtensible Markup Language
NetajiGandi1
 
SQLPASS AD501-M XQuery MRys
Michael Rys
 
TEST UPLOAD
James Meldrum
 
01 qmds2005 session01
Niit Care
 
Ad

More from Marek Maśko (7)

PDF
SqlDay 2018 - Brief introduction into SQL Server Execution Plans
Marek Maśko
 
PDF
SQL Operations Studio - new multi-platform tool for SQL Server database devel...
Marek Maśko
 
PDF
SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...
Marek Maśko
 
PDF
SQLDay 2017 - Database Unit Tests with tSQLt
Marek Maśko
 
PDF
SQL Server - Using Tools to Analyze Query Performance
Marek Maśko
 
PDF
DevOps and databases
Marek Maśko
 
PDF
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
Marek Maśko
 
SqlDay 2018 - Brief introduction into SQL Server Execution Plans
Marek Maśko
 
SQL Operations Studio - new multi-platform tool for SQL Server database devel...
Marek Maśko
 
SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...
Marek Maśko
 
SQLDay 2017 - Database Unit Tests with tSQLt
Marek Maśko
 
SQL Server - Using Tools to Analyze Query Performance
Marek Maśko
 
DevOps and databases
Marek Maśko
 
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
Marek Maśko
 

Recently uploaded (20)

PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
July Patch Tuesday
Ivanti
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
July Patch Tuesday
Ivanti
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 

SQL Server - Querying and Managing XML Data

  • 1. Polish SQL Server User Group Querying and Managing XML Data CHAPTER 7
  • 2. Polish SQL Server User Group About the Author Marek Maśko • Principal Database Analyst at Sabre • Working with SQL Server for ~7 years • SQL DBA, Dev & Architect • MCP since 2012 • Contact Information: Email: [email protected] LinkedIn: https://pl.linkedin.com/in/marekmasko Twitter: @MarekMasko
  • 3. Polish SQL Server User Group Agenda • XML Introduction • Returning Results As XML with FOR XML • Querying XML Data with XQuery • Using the XML Data Type
  • 4. Polish SQL Server User Group XML INTRODUCTION
  • 5. Polish SQL Server User Group Basic Example
  • 6. Polish SQL Server User Group Terminology • A tag is a markup construct that begins with < and ends with >. Tags come in three flavors: start-tag, such as <section>; end-tag, such as </section>; empty-element tag, such as <line-break />.
  • 7. Polish SQL Server User Group Terminology • An element is a logical document component that either begins with a start-tag and ends with a matching end-tag or consists only of an empty- element tag. The characters between the start-tag and end-tag, if any, are the element's content. <greeting>Hello, world!</greeting>; <line-break />.
  • 8. Polish SQL Server User Group Terminology • An attribute is a markup construct consisting of a name–value pair that exists within a start-tag or empty-element tag. <img src="madonna.jpg" alt="Madonna" />; <step number="3">Connect A to B.</step>. • An XML attribute can only have a single value and each attribute can appear at most once on each element.
  • 9. Polish SQL Server User Group Basic Example
  • 10. Polish SQL Server User Group XML • Well-formed • Ordered • Case-sensitive Unicode • Character data section <![CDATA[ … ]]> • Prolog <?xml version="1.0" encoding="ISO-8859-15"?> • XML Document vs XML Fragments
  • 11. Polish SQL Server User Group XML Namespace
  • 12. Polish SQL Server User Group XML Schema • Standard to describe the metadata of XML documents • XML Schema Description (XSD) document • Document validation • Typed XML
  • 13. Polish SQL Server User Group RETURNING RESULTS AS XML WITH FOR XML Lesson 01
  • 14. Polish SQL Server User Group FOR XML clause • Four modes: –RAW –AUTO –PATH –EXPLICIT
  • 15. Polish SQL Server User Group LESSON REVIEW
  • 16. Polish SQL Server User Group Question 1 • Which FOR XML options are valid? (Choose all that apply.) A. FOR XML AUTO B. FOR XML MANUAL C. FOR XML DOCUMENT D. FOR XML PATH
  • 17. Polish SQL Server User Group Question 2 • Which directive of the FOR XML clause should you use to produce element-centric XML? A. ATTRIBUTES B. ROOT C. ELEMENTS D. XMLSCHEMA
  • 18. Polish SQL Server User Group Question 3 • Which FOR XML options can you use to manually format the XML returned? (Choose all that apply.) A. FOR XML AUTO B. FOR XML EXPLICIT C. FOR XML RAW D. FOR XML PATH
  • 19. Polish SQL Server User Group QUERYING XML DATA WITH XQUERY Lesson 02
  • 20. Polish SQL Server User Group XQuery • The standard language for browsing XML instances and returning XML. • XQuery is, like XML, case sensitive. • XQuery returns sequences. Sequences can include atomic values or complex values (XML nodes). • Every identifier in XQuery is a qualified name, or a QName. A QName consists of a local name and, optionally, a namespace prefix. • The SQL Server database engine processes XQuery inside T-SQL statements through XML data type methods.
  • 21. Polish SQL Server User Group Sequences
  • 22. Polish SQL Server User Group XQuery Functions • Numeric functions: ceiling(), floor(), round() • String functions: concat(), contains(), substring(), string- length(), lower-case(), upper-case() • Boolean and Boolean constructor functions: not(), true(), false() • Nodes functions: local-name(), namespace-uri() • Aggregate functions: count(), min(), max(), avg(), sum() • Data accessor functions: data(), string() • SQL Server extension functions: sql:column(), sql:variable()
  • 23. Polish SQL Server User Group Navigation • XPath expressions • Every path consists of a sequence of steps Node-name/child::element-name[@attribute-name=value] • Step may consist of three parts: – Axis Specifies the direction of travel. In the example, the axis is child::, which specifies child nodes of the node from the previous step. – Node test Specifies the criterion for selecting nodes. In the example, element-name is the node test; it selects only nodes named element- name. – Predicate Further narrows down the search. In the example, there is one predicate: [@attribute-name=value], which selects only nodes that have an attribute named attribute-name with value value, such as [@orderid=10952].
  • 24. Polish SQL Server User Group Axis
  • 25. Polish SQL Server User Group Node test • A node test follows the axis you specify • Possibilities: – Simple node name – Wildcard (*) = any principal node • Node type tests: – comment() Allows you to select comment nodes. – node() True for any kind of node. Do not mix this with the asterisk (*) wildcard; * means any principal node, whereas node() means any node at all. – processing-instruction() Allows you to retrieve a processing instruction node. – text() Allows you to retrieve text nodes, or nodes without tags.
  • 26. Polish SQL Server User Group Predicates • Numeric – select nodes by position: –/x/y[1] –(/x/y)[1] • Boolean – select nodes for which the predicate evaluates to true
  • 27. Polish SQL Server User Group Value comparison operators
  • 28. Polish SQL Server User Group IF..THEN..ELSE if (<expression1>) then <expression2> else <expression3> • Like T-SQL CASE expression
  • 29. Polish SQL Server User Group FLWOR Expressions • FOR - bind iterator variables to input sequences • LET - assign a value to a variable for a specific iteration • WHERE - filter the iteration • ORDER BY - control the order based on atomic values • RETURN - format the resulting XML
  • 30. Polish SQL Server User Group LESSON REVIEW
  • 31. Polish SQL Server User Group Question 1 • Which of the following is not a FLWOR clause? A. for B. let C. where D. over E. return
  • 32. Polish SQL Server User Group Question 2 • Which node type test can be used to retrieve all nodes of an XML instance? A. Asterisk (*) B. comment() C. node() D. text()
  • 33. Polish SQL Server User Group Question 3 • Which conditional expression is supported in XQuery? A. IIF B. if..then..else C. CASE D. switch
  • 34. Polish SQL Server User Group USING THE XML DATA TYPE Lesson 03
  • 35. Polish SQL Server User Group XML Data Type Methods • query() – support querying • value() – support retrieving atomic values • exist() – support checking existence • modify() – support modifying sections within the XML data • nodes() – support shredding XML data into multiple rows in a result set
  • 36. Polish SQL Server User Group Using the XML Data Type for Dynamic Schema
  • 37. Polish SQL Server User Group XML Indexes • XML can be up to 2GB of data • Primary XML index – shredded persisted representation of the XML values; • Three types of Secondary XML indexes: –PATH –VALUE –PROPERTY
  • 38. Polish SQL Server User Group LESSON REVIEW
  • 39. Polish SQL Server User Group Question 1 • Which of the following is not an XML data type method? A. merge() B. nodes() C. exist() D. value()
  • 40. Polish SQL Server User Group Question 2 • What kind of XML indexes can you create? (Choose all that apply.) A. PRIMARY B. PATH C. ATTRIBUTE D. PRINCIPALNODES
  • 41. Polish SQL Server User Group Question 3 • Which XML data type method do you use to shred XML data to tabular format? A. modify() B. nodes() C. exist() D. value()
  • 42. Polish SQL Server User Group THANK YOU!
  • 43. Polish SQL Server User Group Resources • Book: Training Kit Exam 70-461 • Scripts for Training Kit