12/9/2018 6:15 AM © 2004 Microsoft Corporation. All rights reserved.

Slides:



Advertisements
Similar presentations
Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Advertisements

OASIS OData Technical Committee. AGENDA Introduction OASIS OData Technical Committee OData Overview Work of the Technical Committee Q&A.
XML: Extensible Markup Language
Inside Data Access with SQLXML: Architecture Guide Rolandas Gricius MCT, MCSE, MCSD Adapted From.
1 COS 425: Database and Information Management Systems XML and information exchange.
XML –Query Languages, Extracting from Relational Databases ADVANCED DATABASES Khawaja Mohiuddin Assistant Professor Department of Computer Sciences Bahria.
Module 9 Designing an XML Strategy. Module 9: Designing an XML Strategy Designing XML Storage Designing a Data Conversion Strategy Designing an XML Query.
Indexing XML Data Stored in a Relational Database VLDB`2004 Shankar Pal, Istvan Cseri, Gideon Schaller, Oliver Seeliger, Leo Giakoumakis, Vasili Vasili.
Overview of XPath Author: Dan McCreary Date: October, 2008 Version: 0.2 with TEI Examples M D.
DAT304 Leveraging XML and HTTP with Sql Server Irwin Dolobowsky Program Manager Webdata Group.
XQuery Your gateway to manipulating XML in SQL Server 2005.
Module 17 Storing XML Data in SQL Server® 2008 R2.
DAT319 XML In The Database The XML Data Type In SQL Server 2005 (Code Named "Yukon") Michael Rys Program Manager SQL Server XML Technologies Microsoft.
2.2 SQL Server 2005 的 XML 支援功能. Overview XML Enhancements in SQL Server 2005 The xml Data Type Using XQuery.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
DBA230 Introducing SQL Server 2000 Reporting Services Jason Carlson Product Unit Manager SQL Server Microsoft Corporation.
Using XML in SQL Server 2005 NameTitleCompany. XML Overview Business Opportunity The majority of all data transmitted electronically between organizations.
OFC304 Excel 2003 Overview: XML Support Joseph Chirilov Program Manager.
Comparing XSLT and XQuery Michael Kay XTech 2005.
SQL Server 2005: Deep Dive On XML And XQuery Michael Rys DAT405 Program Manager, SQL Server XML Technologies Microsoft Corporation.
Sofia, Bulgaria | 9-10 October Using XQuery to Query and Manipulate XML Data Stephen Forte CTO, Corzen Inc Microsoft Regional Director NY/NJ (USA) Stephen.
Data File Access API : Under the Hood Simon Horwith CTO Etrilogy Ltd.
Developing Reporting Solutions with SQL Server
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
DBSQL 14-1 Copyright © Genetic Computer School 2009 Chapter 14 Microsoft SQL Server.
Open Data Protocol * Han Wang 11/30/2012 *
Exploiting New Capabilities for Search And Organization Kerem Karatal DAT307 Lead Program Manager Microsoft Corporation.
OFC335 Microsoft Office Word 2007 XML Programmability: True Data/View Separation and Rich Eventing for Custom XML Tristan Davis Program Manager Microsoft.
DAT 379 XML Today And Tomorrow Mark Fussell Lead Program Manager Microsoft Corporation.
Paul Cotton, XML Query WG1 Querying XML Documents Paul Cotton ZIG Washington, Dec 7, 2000.
5/24/01 Leveraging SQL Server 2000 in ColdFusion Applications December 9, 2003 Chris Lomvardias SRA International
I2RS draft-rfernando-yang-mods.txt I2RS Yang Extensions draft-rfernando-yang-data-mods R.Fernando, P.Chinnakannan, M.Madhayyan, A.Clemm.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Copyright© 2005 Oracle Corp.1 SQL/XML Jim Melton USA: Oracle Corp. JTC1 SC32N1632.
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
XML and Database.
Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.
SQL Server 2005: Extending the Type System with XML.
Mr.Prasad Sawant, MIT Pune India Introduction to DBMS.
Session 1 Module 1: Introduction to Data Integrity
Martin Kruliš by Martin Kruliš (v1.1)1.
SQLXML XML Technology For SQL Server Brian Moore Developer and Platform Strategy Group Microsoft Corporation.
Module 3: Using XML. Overview Retrieving XML by Using FOR XML Shredding XML by Using OPENXML Introducing XQuery Using the xml Data Type.
DAT 405 Extreme SqlXml Irwin Dolobowsky Program Manager – SqlXml Microsoft Corporation.
DAT 378 SQL Server 2000 Bringing The Best of Reporting Services and Analysis Services Together Sean Boon Program Manager, BI Systems
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
DAT 400 Inside Data Access with SQLXML: Architecture Guide Alexander Vaschillo Lead Program Manager WebData XML Group Microsoft Corporation.
I Copyright © 2004, Oracle. All rights reserved. Introduction.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
XSLT ‘Extreme’ TLA327 Dave McMahon MCAD,MCDBA,MVP – Connected Systems Developer.
Understanding Core Database Concepts Lesson 1. Objectives.
Building Enterprise Applications Using Visual Studio®
Introducing SQL Server 2000 Reporting Services
XML: Extensible Markup Language
Querying and Transforming XML Data
Chris Menegay Sr. Consultant TECHSYS Business Solutions
Avalon – Using Data In Your Applications
Upgrading Your C# Programming Skills to Be a More Effective Developer
XML in Web Technologies
Searching Business Data with MOSS 2007 Enterprise Search
Database Processing with XML
Optimizing Microsoft SQL Server 2008 Applications Using Table Valued Parameters, XML, and MERGE
Searching Business Data with MOSS 2007 Enterprise Search
Building event-driven, long-running apps with Windows workflow
Data Model.
Chapter 8 Advanced SQL.
Understanding Core Database Concepts
XML? What’s this doing in my database? Adam Koehler
Presentation transcript:

12/9/2018 6:15 AM © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

DAT327 SQL Server 2005 (Codenamed “Yukon”): Inside XQuery Michael Rys, Arpan Desai Program Managers SQL Server XML Technologies Microsoft Corporation © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Usage Of XML →Transport, Store and Query XML data Data exchange 12/9/2018 6:15 AM Usage Of XML Data exchange Business-to-business (B2B), business-to-consumer (B2C), application to application (A2A) XML is ubiquitous, extensible, platform independent transport format Content management Documents Mail Messages Data/view separation Documents, style sheets, transforms Messaging Simple Object Access Protocol (SOAP) →Transport, Store and Query XML data © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

XML Query Mechanisms Status quo 12/9/2018 6:15 AM XML Query Mechanisms Status quo XPath 1.0 W3C Recommendation Used in SQL Server 2000: SQLXML and OpenXML Navigation, no reshaping Limited knowledge about types XSLT Data-driven reshaping (uses XPath) MSXML, System.XML Hard to author and optimize for large amount of data No data modification language (DML) © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

XML Query Mechanisms XQuery 12/9/2018 6:15 AM XML Query Mechanisms XQuery Functional, declarative query language Combines XPath with node construction Operates on (XML Schema-)typed and unconstrained XML Designed to operate on large amount of data Optimizable © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

XQuery History Dec 1998: W3C Workshop on Querying XML 12/9/2018 6:15 AM XQuery History Dec 1998: W3C Workshop on Querying XML Sep 1999: Start of W3C XQuery WG Nov 2003: XQuery Data Model, Functions and Operators, Syntax and Semantics in Last Call Summer 2004 (expected): First Working Draft of XQuery Full-Text language proposal End of 2005 (expected): XQuery (without Full-Text, DML) in recommendation During 2006/7 (expected): Full-Text, DML in recommendation © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

XQuery Example declare namespace n = "http://example.com/ns1"; for $s in /n:doc[@id = 123]//n:sec[@num >= 3] Where $s/n:heading return <topic>{data($s/n:heading)}</topic> Query Prolog Query Body © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

XQuery Features FLWOR: FOR / LET / WHERE / ORDER BY / RETURN FOR LET 12/9/2018 6:15 AM XQuery Features FLWOR: FOR / LET / WHERE / ORDER BY / RETURN FOR LET WHERE ORDER BY RETURN Includes XPath 2.0 (/doc[@id = 123]) Element constructors (<topic>{…}</topic>) Order-preserving operators Input order (FLWR) Document order (XPath, union) Statically (or dynamically) typed, Strong typing with schema, weak typing without schema SQL: SELECT FROM WHERE ORDER BY & SET © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

XML Schema As Type System 12/9/2018 6:15 AM XML Schema As Type System XML Schema (W3C standard) Rich mechanism for type definitions and validation constraints Can be used to constrain XML documents Benefits of typed data Guarantees shape of data Allows storage and query optimizations XML type system Store XML schemas in system metadata See DAT319 for more information © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

12/9/2018 6:15 AM XQuery Language © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

XML Data Modification Insert, update, and delete XQuery extensions XML sub-tree modification: Add or delete XML sub-trees Update values Generate consistent state © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

XML-DML: insert replace value of delete 12/9/2018 6:15 AM XML-DML: insert replace value of delete delete /Customer/Order[id = 42] insert <notes/> into /Customer replace value of (/Customer/name)[1] with “Nils” insert <notes/> as last into /Customer Customer insert <notes/> as first into /Customer notes notes insert <notes/> before /Customer/name name: xs:string Order notes insert <notes/> after /Customer/name “Janine” “Nils” id: xs:int Target needs to be statically one node 42 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

XQuery And XML-DML In SQL Server 2005 12/9/2018 6:15 AM XQuery And XML-DML In SQL Server 2005 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

XQuery And XML-DML In SQL Server 2005 12/9/2018 6:15 AM XQuery And XML-DML In SQL Server 2005 Beta2 is aligned on Nov. 2003 XQuery Last Call working draft Added XML Data Modification Applies to single XML data type instance Methods on XML data type: query(), value(), exist(), modify(), nodes() Use SQL to iterate over collection of instances (XML-typed column) Can refer to relational data Take advantage of Schema-collection information to operate on typed XML data © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

12/9/2018 6:15 AM XQuery: value() Extracts an XQuery value into the SQL value and type space SELECT T.x.value( ‘(/n:doc[@id = 123]//n:sec[@num >= 3]/@num)[1]’, ’int’) FROM T Expression has to statically be a singleton String value of atomized XQuery item is cast to SQL type SQL type has to be SQL scalar type © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

12/9/2018 6:15 AM XQuery: nodes() Provides OpenXML-like functionality on XML data type column in SQL Server 2005 Returns a row per selected node Each row contains a special XML data type instance that Has the context node set to the selected node Preserves the original structure and types Can only be used with the XQuery methods, count(*), IS (NOT) NULL (not modify()) © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

sql:column()/sql:variable() 12/9/2018 6:15 AM sql:column()/sql:variable() Map SQL value and type into XQuery values and types in context of XQuery or XML-DML sql:variable(): accesses a SQL variable declare @value int set @value=42 select * from T where T.x.exist(‘/a/b[@id=sql:variable(“@value”)]’)=1 sql:column(): accesses another column value tables: T(key int, x xml), S(key int, val int) select * from T join S on T.key=S.key where T.x.exist(‘/a/b[@id=sql:column(“S.val”)]’)=1 Restrictions in SQL Server “Yukon”: No XML, CLR UDT or deprecated text/ntext/image © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

12/9/2018 6:15 AM XQuery: modify() Used with SET: declare @xdoc xml set @xdoc.modify(‘delete /a/b[@id=“42”]’) update T set T.xdoc.modify(‘insert <b/> into /a’) where T.id=1 Relational row-level concurrency: whole XML instance is locked © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

XQuery In SQL Server 2005 Subset of Standard implemented. For example: No LET No user-defined XQuery functions Subset of XQuery built-in functions No XQuery validation (use XML datatype validation) No expression on a constructed node Dynamic errors are mapped to empty sequence No XQuery joins across different XML instances (combine instances using FOR XML) © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Guidelines And Best Practices XQuery and XML-DML in SQL Server 2005 12/9/2018 6:15 AM Guidelines And Best Practices XQuery and XML-DML in SQL Server 2005 Exploit type information if available Use indices Use XQuery for property promotions Static typing provides performance benefits and early error discovery Use [1] or explicit FLWR to avoid static errors due to cardinality mismatch Use explicit casts to avoid static type errors © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

XQuery In .NET Framework 2005 Beta 1 is aligned on Nov. 2003 XQuery Last Call working draft New common query architecture Both XSLT and XQuery compiled down to MSIL Utilizes schema information from XmlSchemaSet Supports embedding of T-SQL for easy retrieval of data from SQL Server Supports CLR extension objects to enable highly custom functionality © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Supported XML Sources XML 1.0 XmlReader XPathNavigator 12/9/2018 6:15 AM Supported XML Sources XML 1.0 Files, streams, etc. XmlReader Can be implemented streaming over custom formats (ex: binary XML, ASN.1) XPathNavigator Can be implemented random access over custom structures (ex: registry, assembly metadata) sql:query() extension function Enables easy retrieval of relational data from SQL Server for processing in XQuery © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

XQuery in the .NET Framework 2.0 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

12/9/2018 6:15 AM sql:query() Enables utilization of T-SQL to retrieve data for processing in XQuery Can utilize FOR XML queries Also supports client side FOR XML Extremely useful for legacy stored procs T-SQL queries can be parameterized We don’t alter query string © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

12/9/2018 6:15 AM XQuery In System.Xml Larger portion of standard implemented. Differences in support: LET User-defined XQuery functions Dynamic errors available Joins across different XML sources allowed © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

More information on XML datatype Whitepapers and other information 12/9/2018 6:15 AM More information on XML datatype DAT319 Presentation Whitepapers and other information http://msdn.microsoft.com/sql http://msdn.microsoft.com/xml Newsgroup news:microsoft.public.sqlserver.xml W3C XQuery http://www.w3.org/XML/Query.html Our contact information Email: arpande@microsoft.com, mrys@microsoft.com Weblog: http://blogs.msdn.com/arpande, http://www.sqljunkies.com/weblog/mrys © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Exclusive TechEd Offer! Receive Beta 2 of SQL Server 2005 12/9/2018 6:15 AM Next Steps: SQL Server 2005 Exclusive TechEd Offer! Receive Beta 2 of SQL Server 2005 Register for SQL Server 2005 Beta 2 at: http://www.msteched.com/SqlBetaBits.aspx Visit the SQL Server 2005 website: www.microsoft.com/sql/2005 Learn more about SQL Server 2005 at TechEd Hands On Labs Rooms 6E and 6F 13 Hands On Labs Ask the Experts Track Cabanas located around CommNet Experts Available All Week © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Please fill out a session evaluation on CommNet 12/9/2018 6:15 AM Please fill out a session evaluation on CommNet Q1: Overall satisfaction with the session Q2: Usefulness of the information Q3: Presenter’s knowledge of the subject Q4: Presenter’s presentation skills Q5: Effectiveness of the presentation © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

© 2004 Microsoft Corporation. All rights reserved. 12/9/2018 6:15 AM © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.