Surviving parsing XML with T-SQL

Slides:



Advertisements
Similar presentations
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Advertisements

XML DOCUMENTS AND DATABASES
Summary. Chapter 9 – Triggers Integrity constraints Enforcing IC with different techniques –Keys –Foreign keys –Attribute-based constraints –Schema-based.
Some Introductory Programming 1. Structured Query Language - used for queries. - a standard database product. 2. Visual Basic for Applications - use of.
RMS Importer/Exporter Create configuration for the MedAustron Control System PP a-ABR_RMSImporterExporter.pptm abrett/mmarchha RMS Importer/Exporter.
DAT304 Leveraging XML and HTTP with Sql Server Irwin Dolobowsky Program Manager Webdata Group.
Oracle Developer Tools for Visual Studio.NET Curtis Rempe.
RELATIONAL FAULT TOLERANT INTERFACE TO HETEROGENEOUS DISTRIBUTED DATABASES Prof. Osama Abulnaja Afraa Khalifah
Improving Database Performance Derrick Rapley
Programming in R SQL in R. Running SQL in R In this session I will show you how to: Run basic SQL commands within R.
Lifecycle Server XM Edition. XM Edition Features Full Oracle and SQL Server Support –Oracle & –SQL Server 2005 Improved XML import/export.
BI Practice March-2006 COGNOS 8BI TOOLS COGNOS 8 Framework Manager TATA CONSULTANCY SERVICES SEEPZ, Mumbai.
Query Optimization CMPE 226 Database Systems By, Arjun Gangisetty
Performance. Performance Performance is a critical issue especially in a multi-user environment. Benchmarking is one way of testing this.
Drill-Through Features Cognos 8 BI. Objectives  In this module we will examine:  Cognos 8 Drill Through Overview  Model / Package Drill Through  Cross.
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
Physical Layer of a Repository. March 6, 2009 Agenda – What is a Repository? –What is meant by Physical Layer? –Data Source, Connection Pool, Tables and.
Challenges to designing financial warehouses: lessons learnt.
Steve Simon MVP SQL Server BI
Introduction to Mongo DB(NO SQL data Base)
Creating Database Objects
Key Terms Attribute join Target table Join table Spatial join.
Query Optimization Techniques
What’s new in SQL Server 2017 for BI?
Execution Planning for Success
Data Virtualization Demoette… ADO.NET Client
Data Virtualization Tutorial… CORS and CIS
Report Builder as Self Service BI Solution
A time travel with temporal tables
Database Systems: Design, Implementation, and Management Tenth Edition
Efficiently Searching Schema in SQL Server
Prepared by : Ankit Patel (226)
A time travel With temporal tables Leonel Abreu
Challenges to designing financial warehouses, lessons learnt
Steve Simon MVP SQL Server BI
Data Virtualization Tutorial: JSON_TABLE Queries
Searching Business Data with MOSS 2007 Enterprise Search
Splitting a Database: How and Why
Applying Data Warehouse Techniques
Analytics for Apps: Landing and Loading Data into SQL Data Warehouse
Searching Business Data with MOSS 2007 Enterprise Search
Discovering SSRS 2016 in Azure: Dataset to Deployment
Principles of report writing
Agenda Database Development – Best Practices Why Performance Matters ?
The Killing Cursors Cyndi Johnson
DAX and the tabular model
Intro to NoSQL Databases
Creating Dashboards with PerformancePoint Services
Orchestration and data movement with Azure Data Factory v2
Populating a Data Warehouse
Becoming a successful Business Intelligence developer
PowerShell for the DBA: Why I love my inner pig-dog
Welcome to SQL Saturday Denmark
Cyndi Johnson Senior Software Engineer at AdvancedMD Killing Cursors.
2/18/2019.
Relational Database Design
Chapter 8 Advanced SQL.
SQL Server Reporting Services 2017 on Steroids!!
SQL Server 2016 Security Features
Let’s Build a Tabular Model in Azure
Database Systems: Design, Implementation, and Management Tenth Edition
Query Optimization.
Cyndi Johnson Senior Software Engineer at AdvancedMD Killing Cursors.
The SSRS RESTful API George Walkey Sr. DBA, Patient First Corp
SSIS Data Integration Data Warehouse Acceleration
Creating Database Objects
Efficient and Effective coding of stored procedures
Reports Report builder meets the challenge by making it easy to design, publish, and distribute professional, production-quality reports in a variety of.
The SSRS RESTful API George Walkey Sr. DBA, Patient First Corp
Integrated Statistical Production System WITH GSBPM
Presentation transcript:

Surviving parsing XML with T-SQL Steve Simon MVP SQL Server BI http://www.infogoldusa.com

SQL Server MVP Atrion Networking Corporation (Providence RI) Involved with database design for 29 years + Presenter at numerous PASS summits. Presenter at numerous SQL Saturday events. Presented at Copenhagen Nordic Rally in March. Regular contributor on SQLShack.com

Facts of life Data is not always stored in a simple format. Often data is imported from xml documents. Murphy’s law states that the data will be at the bottom of the tree. Parsing data from the tree is CPU consuming.

Today’s challenge We need a list of reports that have been run over the past 60 days. We need the name of the report. We need the dataset and data source name. We need the fields that are displayed in the report.

Let’s get started

A practical case Conversion of warehouse reports to run off of “Service Now”. Which reports are still active? Who has used them and when? Will the tables in “Service Now” contain the necessary fields?

All of our data resides in the Report Server Database

Selecting the Schema via a CTE ;WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' ,'http://schemas.microsoft.com/sqlserver/reporting/reportdesigner' AS rd)

We shall be utilizing two tables dbo.Catalog dbo.ExecutionLogStorage

We execute the CTE

We convert the content field to XML

FROM (SELECT RPT.Path AS ReportPath ,RPT.name AS ReportName ,CONVERT(xml, CONVERT(varbinary(max), RPT.content)) AS contentXML FROM [SQLSaturday386Albany].dbo.[Catalog] AS RPT INNER JOIN [SQLSaturday386Albany].dbo.ExecutionLogStorage Storage ON RPT.ItemID = Storage.ReportID WHERE RPT.Type = 2 –-i.e. a Report ) AS RPT

Content XML contains the ‘result set’

XML containing the field names

Type definitions

Cross Apply to get down the different branches of the tree

Ascertaining the Dataset and Data Source Names

Fields within our reports

Data source, dataset and parameters passed

The query is also available from the report

Demo 1

Reporting

Demo 2

Take-Away

Why battle with XML Parsing and processing XML data feeds. Understanding the tree structure helps with coding. Techniques may be applied to reporting. Getting access to critical data.

Surviving parsing XML with T-SQL Steve Simon MVP SQL Server BI http://www.infogoldusa.com