DAT 400 Inside Data Access with SQLXML: Architecture Guide Alexander Vaschillo Lead Program Manager WebData XML Group Microsoft Corporation.

Slides:



Advertisements
Similar presentations
Introduction to NHibernate By Andrew Smith. The Basics Object Relation Mapper Maps POCOs to database tables Based on Java Hibernate. V stable Generates.
Advertisements

Designing InfoPath Forms: The Dos and Donts Deploying InfoPath Forms: Making the right choice Adding custom business logicin case the built-in stuff isnt.
XML: Extensible Markup Language
ADO vs ADO.NET ADOADO.NET Client/server coupledDisconnected collection of data from data server Uses RECORDSET object (contains one table) Uses DATASET.
Michael Pizzo Software Architect Data Programmability Microsoft Corporation.
Inside Data Access with SQLXML: Architecture Guide Rolandas Gricius MCT, MCSE, MCSD Adapted From.
Peoplesoft: Building and Consuming Web Services
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Objective In this session we will discuss about : What is ADO. NET ?
SQL Server 2000 and XML Erik Veerman Consultant Intellinet Business Intelligence.
Web service testing Group D5. What are Web Services? XML is the basis for Web services Web services are application components Web services communicate.
Stored Procedures Dr. Ralph D. Westfall May, 2009.
DAT304 Leveraging XML and HTTP with Sql Server Irwin Dolobowsky Program Manager Webdata Group.
Trends in Database Development: XML,.NET, WinFS Alexander Vaschillo Microsoft Alexander Vaschillo Microsoft.
2.2 SQL Server 2005 的 XML 支援功能. Overview XML Enhancements in SQL Server 2005 The xml Data Type Using XQuery.
XML Fundementals XML vs.. HTML XML vs.. HTML XML Document (elements vs. attributes) XML Document (elements vs. attributes) XML and RDBMS XML and RDBMS.
“This presentation is for informational purposes only and may not be incorporated into a contract or agreement.”
Integrating XML with Microsoft SQL Server ©NIITeXtensible Markup Language/Lesson 9/Slide 1 of 31 Objectives In this lesson, you will learn to: * Generate.
Copyright © 2014, 2015 William R. Vaughn All rights reserved William R. Vaughn.
Native Support for Web Services  Native Web services access  Enables cross platform interoperability  Reduces middle-tier dependency (no IIS)  Simplifies.
OFC304 Excel 2003 Overview: XML Support Joseph Chirilov Program Manager.
Visual Studio ®.NET Data with XML Carlotta Eaton ( Associate Professor of IST New River Community College Slides by Microsoft Modified.
DATABASE and XML Moussa Mané. Learning Objectives ● Learn about Native XML Databases ● Learn about the conversion technology available ● Understand New.
XP New Perspectives on XML, 2 nd Edition Tutorial 10 1 WORKING WITH THE DOCUMENT OBJECT MODEL TUTORIAL 10.
DAT336 Connected vs Disconnected Data Access in ADO.NET Pablo Castro Program Manager – ADO.NET Team Microsoft Corporation.
Introducing Reporting Services for SQL Server 2005.
Developing Reporting Solutions with SQL Server
DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.
OFC 303 Advanced Word XML: Customer-Defined Schemas Brian Jones Program Manager Authoring Services.
Ronnie Saurenmann Principal Architect Microsoft Switzerland.
DAT 379 XML Today And Tomorrow Mark Fussell Lead Program Manager Microsoft Corporation.
DAT 330 Building Web Services with SQL Server and SQLXML 3.0 Alexander Vaschillo Lead Program Manager WebData XML Group Microsoft Corporation.
5/24/01 Leveraging SQL Server 2000 in ColdFusion Applications December 9, 2003 Chris Lomvardias SRA International
Slide 1.NET Development for Project 2003 Samples from the Project 2003 SDK Jim Corbin Programmer Writer Office Developer Documentation Microsoft Corporation.
James Akrigg Microsoft Ltd Integrating InfoPath Forms Into Workflow Solutions And Business Processes.
Module 18 Querying XML Data in SQL Server® 2008 R2.
DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation.
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
Microsoft Dynamics NAV 2009 and Architecture Overview Name Title Microsoft Corporation.
OFC291 Microsoft® Office Word XML (part 1 of 3): Introduction Martin Sawicki Lead Program Manager.
INT-9: Implementing ESB Processes with OpenEdge ® and Sonic ™ David Cleary Principal Software Engineer.
DEV383 The ADO.NET DataSet and You Jackie Goldstein General Manager Renaissance Computer Systems
DAT430 Extending Microsoft ® ADO.NET Building a Custom Data Factory API DAT430 Extending Microsoft ® ADO.NET Building a Custom Data Factory API Gert E.R.
Chapter 14 1 Chapter 14 Storing and Retrieving XML in SQL Server 2000 November 6, 2001 Sook-Kyo Kwon.
Developing SQL Server 2000 Reporting Services Applications Brian Welcker Group Program Manager SQL Server Reporting Services Microsoft Corporation.
NSF DUE ; Wen M. Andrews J. Sargeant Reynolds Community College Richmond, Virginia.
SQLXML XML Technology For SQL Server Brian Moore Developer and Platform Strategy Group Microsoft Corporation.
Microsoft Visual Studio 2005 Tools for the Office System: Building Office Solutions Using Visual Studio 2005 Tools for Office Andrew Coates Developer Evangelist.
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.
DAT200 Microsoft® ADO.NET for ADO Classic Developers: Introducing ADO.NET Jackie Goldstein Renaissance Computer Systems
Dev399 SQLXML: XML Views and Relational Data Irwin Dolobowsky Program Manager Webdata Group Microsoft Corporation.
ADO.NET 3.0 – Entity Data Model Gert E.R. Drapers Chief Software Architect Visual Studio Team Edition for Database Professionals Microsoft Corporation.
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
OFC311 Developing Microsoft Office InfoPath 2003 Solutions: Technical Drilldown Part 1 Tudor Toma Group Program Manager Office Microsoft Corporation.
In this session, you will learn to: Understand managed code Create managed database objects Define the Hypertext Transfer Protocol endpoints Implement.
XML and SQL Server Better friends than you thought Matt Hartman.
Data Access. ADO.NET ADO.NET is the primary library for building database solutions within the.NET Framework. ADO.NET does not replace ADO. ADO and OLEDB.
DAT 390 Advanced ADO.NET Programming Techniques Jackie Goldstein Renaissance Computer Systems
Top 10 Entity Framework Features Every Developer Should Know
Introducing SQL Server 2000 Reporting Services
Chris Menegay Sr. Consultant TECHSYS Business Solutions
IS444: Modern tools for applications development
IS444: Modern tools for applications development
12/9/2018 6:15 AM © 2004 Microsoft Corporation. All rights reserved.
DAT381 Team Development with SQL Server 2005
Visual Studio 2005 Tools For Office: Creating A Multi-tier Application
Introduction to ASP.NET Parts 1 & 2
Mark Quirk Head of Technology Developer & Platform Group
9/8/ :03 PM © 2006 Microsoft Corporation. All rights reserved.
Presentation transcript:

DAT 400 Inside Data Access with SQLXML: Architecture Guide Alexander Vaschillo Lead Program Manager WebData XML Group Microsoft Corporation

SQLXML Talks SQLXML: XML Technology for SQL Server SQLXML: XML Technology for SQL Server  DAT200, Alexander Vaschillo, Jul 2 8:30 Building Web Services with SQL Server and SQLXML 3.0 Building Web Services with SQL Server and SQLXML 3.0  DAT330, Alexander Vaschillo, Jul 2 18:15 Inside data access with SQLXML: Architecture guide Inside data access with SQLXML: Architecture guide  DAT400, Alexander Vaschillo, Jul 3 10:00

Query/Update Technologies FOR XML (raw, auto, nested, explicit) FOR XML (raw, auto, nested, explicit)  SQL language extension to retrieve XML instead of rowsets XML Views – XPath, XQuery XML Views – XPath, XQuery  Work with your relational database as if it was XML file (through annotated schema) Updategrams/Diffgrams Updategrams/Diffgrams  Update through XML View Bulkload Bulkload  Shred large XML files into existing tables OPENXML OPENXML  Relational view over XML

Access Methods HTTP Access via URL HTTP Access via URL  SQL Query  XPath Query  Templates ADO / OLEDB ADO / OLEDB SQLXML Managed Classes (.NET) SQLXML Managed Classes (.NET) SOAP (Web Services) SOAP (Web Services)

XML Views: XDR or XSD XML Views can be defined as: XML Views can be defined as:  Annotated XDR  Annotated XSD SQL Server 2000 and SQLXML Web Release 1 – only XDR SQL Server 2000 and SQLXML Web Release 1 – only XDR SQLXML 2.0 and SQLXML 3.0 – both XDR and XSD SQLXML 2.0 and SQLXML 3.0 – both XDR and XSD Future – only XSD Future – only XSD

XML Views: XDR Less sophisticated Less sophisticated Used in BizTalk Used in BizTalk Supported in XMLDATA option Supported in XMLDATA option Supported in ViewMapper tool Supported in ViewMapper tool What do your partners use? What do your partners use?

Annotated XDR Example demo demo

XML Views: XSD Richer Richer W3C Standard W3C Standard What do your partners use? What do you think they should be using? What do your partners use? What do you think they should be using? XDR to XSD conversion tool available XDR to XSD conversion tool available New features supported in XSD only New features supported in XSD only  Hide, inverse, max-depth, named relationships, null control, nillable, fixed, default, guid, identity

Annotated XSD Example demo demo

Recommendation Use Annotated XSD whenever possible Use Annotated XSD whenever possible

Flavors of FOR XML RAW RAW  XML representation of rowset AUTO AUTO  Easy hierarchical XML NESTED NESTED  Similar to AUTO EXPLICIT EXPLICIT  Powerful but complex

AUTO vs. Nested NESTED - XML transform always executed on the client side NESTED - XML transform always executed on the client side AUTO – XML transform always executed on the server side AUTO – XML transform always executed on the server side Ignores ClientSideXML property Ignores ClientSideXML property NESTED: NESTED:  Uses base table names rather than views or aliases for element names  Aggregation and GROUP BY is supported  Multiple rowsets not supported

FOR XML or XML Views You can use either to retrieve XML from relational tables You can use either to retrieve XML from relational tables Do you want to talk XML or Relational? Do you want to talk XML or Relational? Do you prefer SQL or XPath? Do you prefer SQL or XPath? XML Views are an abstraction layer XML Views are an abstraction layer Think of XML Views as of SQL Views but hierarchical rather than relational Think of XML Views as of SQL Views but hierarchical rather than relational We recommend XML Views We recommend XML Views

Use FOR XML if: You prefer relational queries (SQL) rather than XML queries (XPath, XQuery) You prefer relational queries (SQL) rather than XML queries (XPath, XQuery) Your XML output mimics the relational database structure Your XML output mimics the relational database structure Some complex cases not supported in XML Views Some complex cases not supported in XML Views In stored procedures In stored procedures

Use XML Views if: You want to think of your database as an XML data source You want to think of your database as an XML data source You prefer XPath to SQL You prefer XPath to SQL You have to generate XML according to an existing XML schema You have to generate XML according to an existing XML schema Your XML output is structured differently from relational tables Your XML output is structured differently from relational tables XML Views are reusable for multiple queries XML Views are reusable for multiple queries

EXPLICIT vs. XML Views Which one is more powerful? Which one is more powerful?  FOR XML EXPLICIT is  XML Views are compiled to EXPLICIT Which one is more efficient? Which one is more efficient?  EXPLICIT can be manually tweaked Which one is easier? Which one is easier?  XML Views are  Comparing XML Views to EXPLICIT is as comparing C++ to Assembler

XML Views vs. EXPLICIT demo demo

The power of EXPLICIT demo demo  Complex hierarchies  Pivoting  Aggregation

Updategrams vs. Diffgrams Both formats are an XML representation of updates to the database Both formats are an XML representation of updates to the database Diffgrams designed as a persistence format for DataSet Diffgrams designed as a persistence format for DataSet Updategrams designed as a flexible format for small XML changes Updategrams designed as a flexible format for small XML changes

Reasons for Updategrams Less verbose than Diffgrams Less verbose than Diffgrams More powerful More powerful Fine control over concurrency Fine control over concurrency Better handling for NULLs Better handling for NULLs Strongly recommend for non-.NET applications Strongly recommend for non-.NET applications

Reasons for Diffgrams Integrated with Dataset in.NET Integrated with Dataset in.NET Diffgrams are auto generated – easier programming model Diffgrams are auto generated – easier programming model Never generate Diffgrams by hand Never generate Diffgrams by hand

The power of Updategrams demo demo  Concurrency  NULLs  Identity propagation

Bulkload vs. OPEN XML Both technologies convert XML to relational Both technologies convert XML to relational Bulkload allows shredding XML into relational tables through XML Views Bulkload allows shredding XML into relational tables through XML Views OPENXML opens a relational view on XML source OPENXML opens a relational view on XML source

Bulkload Middle-tier solution Middle-tier solution Very efficient – uses BCP Very efficient – uses BCP Built on XML Views Built on XML Views Use to load large volumes of XML into relational database Use to load large volumes of XML into relational database Can create relational schema for you Can create relational schema for you Very easy to use Very easy to use

OPENXML Server-side solution Server-side solution Might be slow – loads the entire document in DOM Might be slow – loads the entire document in DOM Use where you need business logic on the server Use where you need business logic on the server Use in stored procedures Use in stored procedures Use to perform relational join of XML data with database tables Use to perform relational join of XML data with database tables Use to pass complex arguments to stored procedures Use to pass complex arguments to stored procedures

Access Methods HTTP Access via URL HTTP Access via URL ADO / OLEDB ADO / OLEDB SQLXML Managed Classes (.NET) SQLXML Managed Classes (.NET) SOAP (Web Services) SOAP (Web Services)

URL Query – Be Careful Cool and easy Cool and easy Run queries from Web Browser Run queries from Web Browser Be careful with “sql=“ feature Be careful with “sql=“ feature  Watch permissions  Allows ad-hoc queries  Recommended only for trusted environments Use parameter driven templates Use parameter driven templates  Business logic has to be on the server

SQLXMLOLEDB Programmatic access to SQLXML features Programmatic access to SQLXML features SQLXML 2.0 and later SQLXML 2.0 and later SQLXMLOLEDB is better optimized for our scenarios than SQLOLEDB SQLXMLOLEDB is better optimized for our scenarios than SQLOLEDB Allows extra properties Allows extra properties  ClientSideXML  Namespaces (for XPath)

SqlXmlAdapter Dataset Fill Update SQLXML Managed Classes XmlReader Database SqlCommand FOR XML XMLVIEW SqlXmlCommand XML XPathXQueryTemplate XML

Managed classes Use for.NET programming Use for.NET programming Use to run XPath, Templates, Updategrams Use to run XPath, Templates, Updategrams Use where you need XML Views Use where you need XML Views  Rich mapping of XML to Relational Use SqlCommand for FOR XML queries Use SqlCommand for FOR XML queries SqlXmlCommand is an Interop layer today SqlXmlCommand is an Interop layer today

SOAP And Web Services WSDL file describing each template and stored proc exposed WSDL file describing each template and stored proc exposed Tool to choose which templates and stored procedures to expose Tool to choose which templates and stored procedures to expose SQLServer IIS/ISAPI Message SP Template Client SOAPMessage WSDL

Web Services Expose Stored procedures and templates as Web Services Expose Stored procedures and templates as Web Services Natural programming model Natural programming model Very easy to access database Very easy to access database  Dataset ds = MyStoredProcedure(param) Use in multi-platform scenarios Use in multi-platform scenarios Use when your connection to the database is HTTP Use when your connection to the database is HTTP  Overhead of serializing all data into XML

Client vs. Server Side XML Conversion of rowsets to XML can happen on the Database server or mid- tier Conversion of rowsets to XML can happen on the Database server or mid- tier Scale out Scale out Free up the server processing cycles Free up the server processing cycles Throughput considerations Throughput considerations  BLOBS larger than 900 bytes  Short rows Wrap existing stored procedures with FOR XML Wrap existing stored procedures with FOR XML

Architecture Query Processor Annotated XSD Mapping Schemas XPath XQuery Query XML SQL Server SQL Server Rowsets FOR XML SQLQueries Queries SQLQueries Queries XMLBulkload BCP/SQLXML Updategrams SQL update/ insert/ delete XML

Additional Resources Web page Web page  Download SQLXML releases at: Download SQLXML releases at:  Contact us Contact us  PSS  news:microsoft.public.sqlserver.xml  us Documentation Documentation  SQL Server 2000 Documentation (Books Online)  Web Release documentation  Books

Resources from Microsoft Press For more information please visit the TechEd Bookshop. SQL & XML

Don’t forget to complete the on-line Session Feedback form on the Attendee Web site

© 2002 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.