Silverkight Viewer for Reporting Services
Got a SQL Server or .NET question? Discuss it in the forums. (SQL Server Forums | Dot NET Forums)
First Time? You can support us by signing up. It takes only 5 seconds. Click here to sign up. If you already have an account, click here to login.

XQuery Lab 62 – Revisiting simple TSQL SELECT operations using XQuery

This post aims to be a quick reference source for the beginners and shows a few simple SELECT examples....

XQuery Lab 56 – Inserting elements with UNICODE values

This post explains how to write XML DML queries uisng XQuery in TSQL that deals with UNICODE character strings....

XQuery Lab 58 - SELECT * FROM XML

Most people find it very difficult to deal with XML documents in TSQL as there is no way to run a ‘blind’ SELECT * query on an XML document to get a quick view of the content stored in it. A “select TOP N *” query can quickly give you a few records from...

XQuery Lab 55 – Extracting values from XML elements that matches a string pattern

Here is another XQuery exercise that uses the contains() function to match a string pattern against an XML element and retrieves values from a sibling element. Here is the input data for this challenge. <ArrayOfCustomField> <CustomField> <Name>abc<...

XQuery Lab 54 – Modifying an XML document with a SELECT Query

This post explains how to modify an XML document from a SELECT query in TSQL...

XQuery Lab 53 – Reading information from SQL Server Extended Event Information XML

This installment of XQuery Labs explains how to read information from the XML document generated by SQL Server Extended Events....

XQuery Lab 52 – A More Intuitive way of reading an RDF document

After reading XQuery Lab 51 , my friend and database expert Brad Schulz send me a note showing another way of achieving the same results. The approach he suggested was much cleaner than my version. My code used the following expression in the WHERE clause...

XQuery Lab 51 – Querying an RDF document using TSQL and XQuery

This installment of XQuery Labs presents a script that reads information from an RDF document using TSQL and XQuery....

XQuery Lab 50 – Reading data from Google Analytics Atom Feed

One of my friends emailed me this morning asking help for reading data from Google Analytics Atom feed, using Query with TSQL. My friend sent me a sample XML document he obtained from Google Analytics and here is the query that reads information from...

XQuery Lab 49 – Deleting rows from a table based on the data in an XML document

We have seen a few examples that demonstrated how to delete elements and attributes from XML documents. In this lab, let us see how to delete rows from a table, based on the data in an XML document. DECLARE @t TABLE (id INT ) INSERT INTO @t(id) SELECT...

XQuery Lab 48 - Sorting Query files in SQL Server Management Studio (SSMS) Solution/Project

I was working on my presentation for 24-hour-pass event on 2nd September and came across the sorting issue with the solution explorer. I have a number of script demos and I wanted to organize them by name. No matter, what I did, the solution explorer...

XQuery Lab 47 – Generating HTML table from XML Data

Welcome to XQuery Lab 47. In this lab, we will see how to generate an HTML table from an XML document, using XQuery. Here is the source data: < CUST COMPANY ="Company1" CONTACT ="Jacob" /> < CUST COMPANY ="Company1"...

XQuery Lab 46 – Extracting Zip Code from an Address Value

I just came across a task to extract ZIP code values from the address column of a table. The address is a single string that contains information such as street, city, state, zip code, apartment number etc. The data comes from a legacy system where the...

XQuery Lab 45 – Delete a given attribute if it is at a specified position

One of the readers recently asked me if we could delete an attribute with a specific name from all the elements of an XML document. However, the deletion should occur only if the attribute is at a given position. Here is the sample data for this Lab....

XQuery Lab 44 – Inserting an XML fragment into an XML Document

In XQuery Lab 10 we saw how to insert an attribute to an XML document and in XQuery Lab 11 , we say how to insert an element to an XML Document. We have not seen an example that inserts an XML fragment to another XML document. So, let us see how to do...
More Posts Next page »

Copyright © Beyondrelational.com