1 / 26

Building Database Applications With SQL Server “Yukon”

Session Code: DAT402. Building Database Applications With SQL Server “Yukon”. Istvan Cseri, Architect Arpan Desai, Program Manager Microsoft Corporation istvanc@microsoft.com arpande@microsoft.com. Tools. Client Application Model. Web & Service Application Model.

hoang
Download Presentation

Building Database Applications With SQL Server “Yukon”

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Session Code: DAT402 Building Database Applications With SQL Server “Yukon” Istvan Cseri, Architect Arpan Desai, Program Manager Microsoft Corporation istvanc@microsoft.com arpande@microsoft.com

  2. Tools Client Application Model Web & Service Application Model Data Systems Application Model Mobile PC & Devices Application Model Command Line Compact Framework System.Console Win FS Yukon Mobile PC Optimized Avalon Windows Forms ASP.NET / Indigo NTService System.Data.SqlServer System.Windows.Forms System.Windows System.Storage System.Web System.Windows System.Windows.Forms System.ServiceProcess Communication Data Presentation System.Collaboration System.Search System.Discovery System.Data System.Windows System.Messaging SqlClient DataSet RealTimeEndpoint UI Element Explorer Media Annotations System.DirectoryServices ActiveDirectory TransientDataSession SqlTypes Mapping Documents Controls Animation System.Remoting Monitoring SignalingSession SqlXML ObjectSpaces Text Element Dialogs Controls System.Runtime.Remoting Logging Uddi Media OdbcClient ObjectSpace Shapes SideBar Control Relevance Activities OleDbClient Query Shape Notification Panel Navigation OracleClient Schema Ink Design System.Web.Services System.MessageBus Transport Queue Web.Service System.Storage Port PubSub System.Windows.Forms System.Web.UI Description Item Core Channel Router Forms Page WebControls Discovery Relationship Contact Service Policy Control Control Adaptors Protocols Media Location Peer Group Print Dialog HtmlControls Design Audio Message Design MobileControls Video Document System.Net System.Web Images Event HttpWebRequest NetworkInformation System.Help System.Speech Personalization System.Xml FtpWebListener Sockets System.Drawing Recognition Synthesis Caching Schema Xpath SslClientStream Cache SessionState System.NaturalLanguageServices Query Serialization WebClient Fundamentals Security Base & Application Services Configuration Deployment/Management System.Windows.TrustManagement System.Timers System.Text System.Web.Configuration System.Collections System.Web System.Security System.Globalization System.Design Generic System.MessageBus.Configuration Administration Permissions Authorization System.Web.Security System.Serialization System.IO System.Configuration Management System.ComponentModel Policy AccessControl System.Threading Ports System.Resources System.CodeDom Principal System.Management Credentials System.MessageBus.Security System.Runtime System.Reflection Token Cryptography System.Deployment Serialization InteropServices System.EnterpriseServices System.Diagnostics CompilerServices System.Transactions

  3. Agenda • SS2K Recap • Scenarios • Yukon XML support • Native XML storage • XML schema support • XML query with insert, update, and delete • ADO.NET and Yukon • SQL Client support • XML Views • Summary

  4. SQL Server 2000Technologies • Server support • FOR XML– generate XML from tables • OpenXML – generate relational rowset from XML • Mid-tier support (SQLXML) • XML views (annotated mapping schemas XSD) • Templates • UpdateGrams/BulkLoad • Access methods • HTTP SOAP (via mid-tier ISAPI) • ADO, OLE DB; ADO.NET

  5. XML ScenariosDocument management… Index, search XML data Doc, E-Mail, … XSLT

  6. XML ScenariosData Exchange… • Platform independent transport format • Loosely-coupled system • B2B, B2C, “A2A” XML data Point-of-Sales Supplier

  7. XML Query, Updates XML ScenariosMid-Tier Collaborative Applications…

  8. Yukon XML SupportRelational and XML integration • Structured and semi-structured data: • Structured data stored relationally • Bi-directional mapping between XML and relational data • Loosely structured and semi-structured data stored in native XML form • Index support with optimizer knowledge • Deep SQL Server integration for XML • Triggers, replication, bulk load, security…

  9. XML Support (Engine) Highlights • XML data type and XML index support • Unified XML and relational store • Both SQL and XQuery supported by same industrial strength infrastructure • Leverages existing SQL engine and optimizer • XQuery with data modification • XML schema enforcement • Client access using ADO.NET

  10. FOR XML and OpenXML • Fully backward compatible with SS2K • FOR XML • New directive TYPE returns XML data type • Nested FOR XML • Assignment to XML data type • Support for new data types • OpenXML: • XML overflow column • New types [n]varchar(max), varbinary(max), UDT

  11. Native XML StoreXML Data Type • Native SQL type • Use for column, variable or parameter CREATE TABLE docs (id INT PRIMARY KEY, xDoc XML NOT NULL) • Store un-typed or typed XML instances • Well-formed and validation checks • Methods on XML data type: • Query(), value(), exist(), XmlNodeRefs(), modify() • XML instances stored as LOB (2GB) • Efficient binary representation

  12. Full-Text Indexing • XML filter • Index and query XML instances • Markup tags removed • Syntax — same as for other columns CREATE FULLTEXT INDEX ON docs (xDoc) • Use full-text search as filter, then XQuery search • Uses full-text index first • Uses XML index on tags, values, paths

  13. Full-Text SearchQuery examples SELECT R.X::query ('//sec[@num=12]') FROM (SELECT * FROM docs WHERE contains (xDoc, 'Wrd1 Wrd2')) R(X) • Supports xml:lang attribute • Uses appropriate language word breaker SELECT * FROM docs WHERE contains (xDoc, 'Visionen', LANGUAGE 'German')

  14. XQuery and XML Datatype

  15. Native XML StoreXML Index • Create XML index on XML column CREATE XML INDEX idx_1 ON docs (xDoc) • Creates indexes on tags, values, paths • Speeds up queries • Results can be served directly from index • Entire query is optimized • Same award winning cost based optimizer • Indexes are used as available

  16. XML Query • XQuery: query XML documents and data • Standards-based: W3C working draft • In document 123, return section heading of section 3 and later SELECT id, xDoc::query(' for $s in /doc[@id = 123]//sec[@num >= 3] return <topic>{data($s/heading)}</topic> ') FROM docs

  17. XQuery Features • FLWR: FOR / LET / WHERE / RETURN • Includes XPath 2.0 (/doc[@id = 123]) • Element constructors (<topic>) • Order-preserving operators • Supports strong typing

  18. XML Data Modification • Insert, update, and delete XQuery extensions • XML sub-tree modification: • Add or delete XML sub-trees • Update values • Add a new section after section 1: UPDATE docs SET xDoc::modify('insert<section num=''2''> <heading>Background</heading> </section>after /doc/section[@num=1]')

  19. XML Schema Support • 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 meta-data

  20. XML Type System • Associate XML namespace with XML type • Query and modify typed XML data DECLARE @x XML('http://www.ms.com/xdb') SET @x = '<p:doc p="http://www.ms.com/xdb"…> ' SELECT @x::query( 'namespace p= "http://www.ms.com/xdb" for $s in /p:doc[@p:id = 123]//p:sec return <topic>{data($s/heading)}</topic>') FROM docs

  21. Strongly Typed XML Datatype

  22. Support for Yukon Inside ADO.NET • Support within System.Data • SqlDataReader • SqlXmlReader GetSqlXmlReader(int i); • DataSet • New XPathDocument column type • Full databinding support • Support within System.Xml • XML Views and XQuery

  23. XML Views3-Part Mapping • Schema-mapping separation • XML schema + relational schema + mapping • Optimizations resulting from having relational schema • Relational domain extensibility • Support for SPs and UDFs • Inline SQL • Tool Support

  24. XML ViewsFeatures • XQuery support over the views • Optimized query translation into T-SQL queries • Leveraging MARS • Databinding over results • BulkLoad - Bulk insert of XML data shredded into tables with ID propagation • XmlAdapter - Instance based updates (XML equivalent of SqlDataAdapter)

  25. Using XML Views

More Related