XQuery Labs - A Collection of XQuery Sample Scripts
from http://beyondrelational.com/modules/2/blogs/28/posts/10279/xquery-labs-a-collection-of-xquery-sample-scripts.aspx
I have always experienced and am convinced that, while learning a programming technique, it is more helpful to see an example that matches our specific requirement, rather than some theoretical stuff. Examples are really good for learning the basics and then the theories will help us to go deeper into the specific technique.
SQL Server 2005 introduced XML data type and a few related technologies like XQuery, XSD etc. People having no previous experience with XQuery or XSD might find it little hard to find a starting point. Initially, this might seem little complex and then as you go ahead, things will get smoother.
I am trying to post a series of XQuery sample scripts. Most of these scripts were created to help people who needed help at various online forums. I guess some of you will find a few examples that closely matches with your specific requirement and will give enough hints to solve the problem you have at hand.
If you don't find an example that matches with your requirement, you could leave me a note and I will try to add it. Given below is the list of XQuery sample scripts that I have currently. I will keep this page updated when a new script is added. So probably it is a good idea to bookmark this page, if you want to keep a watch on the new scripts being posted. Alternatively, you could subscribe to the RSS/ATOM feeds available on this page and instantly get noticed about new posts as well as updated on existing posts.
XQuery Sample Scripts
- XQuery Lab 1 - Transforming rows to columns
- XQuery Lab 2 - An example using OUTER APPLY
- XQuery Lab 3 - Filtering specific nodes
- XQuery Lab 4 - Joining XML Nodes with a Relational Table
- XQuery Lab 5 - Working with Namespaces
- XQuery Lab 6 - Processing Header-Detail information
- XQuery Lab 7 - Extracting a comma separated list of values
- XQuery Lab 8 - How to update the attribute value of an XML variable?
- XQuery Lab 9 - How to delete an attribute from an XML variable?
- XQuery Lab 10 - How to insert an attribute to an XML variable
- XQuery Lab 11 - How to insert an element to an XML variable
- XQuery Lab 12 - Different ways of reading values from an XML variable
- XQuery Lab 13 - Reading values from an XML variable
- XQuery Lab 14 - Applying filters on multiple attributes
- XQuery Lab 15 - How to locate and modify an attribute using a variable?
- XQuery Lab 16 - How to modify an attribute specified by a variable?
- XQuery Lab 17 - How to update the value of an element
- XQuery Lab 18 - How do I delete an element from an XML variable?
- XQuery Lab 19 - How to parse a delimited string?
- XQuery Lab 20 - How to change the position of elements - How to move an element up or down
- XQuery Lab 21 - How to change the position of elements - Move an element to a specific location
- XQuery Lab 22 - How to change the position of elements - Move an item to a specific position
- XQuery Lab 23 - Retrieving values and position of elements
- XQuery Lab 24 - Reading value of an element specified by a variable
- XQuery Lab 25 - Writing a TSQL Function to compare two XML values (Part 1)
- XQuery Lab 26 - Reading values from elements using wildcards
- XQuery Lab 27 - Reading the name of elements using wildcards
- XQuery Lab 28 - How to find the number of child elements of an XML value?
- XQuery Lab 29 - How to find the number of attributes an XML element has?
- XQuery Lab 30 - How to read the value of an attribute at a given position?
- XQuery Lab 31 - How to find the name of an attribute at a given position?
- XQuery Lab 32 - How to check the existence of an attribute in an XML element?
- XQuery Lab 33 - How to run a loop over all the attributes of an XML element?
- XQuery Lab 34 - How to retrieve the child element at a specified position?
- XQuery Lab 35 - How to write a loop to process all the child elements of an XML value?
- XQuery Lab 36 - Writing a TSQL Function to compare two XML values (Part 2)
- XQuery Lab 37 - Working with multiple namespaces
- XQuery Lab 38 - Delete elements having date value older than 30 days
- XQuery Lab 39 - Retrieve Fully qualified path of attributes and elements
- XQuery Lab 40 - Extracting words matching a pattern from a varchar column
- XQuery Lab 41 - Another string parsing example using XQuery
- XQuery Lab 42 - How to Execute a Dynamic OPENXML() Query?
- XQuery Lab 43 - Deleting multiple elements
- XQuery Lab 44 – Inserting an XML fragment into an XML Document
- XQuery Lab 45 – Delete a given attribute if it is at a specified position
- XQuery Lab 46 – Extracting Zip Code from an Address Value
- XQuery Lab 47 – Generating HTML table from XML Data
- XQuery Lab 48 - Sorting Query files in SQL Server Management Studio (SSMS) Solution/Project
- XQuery Lab 49 – Deleting rows from a table based on the data in an XML document
- XQuery Lab 50 – Reading data from Google Analytics Atom Feed
- XQuery Lab 51 – Querying an RDF document using TSQL and XQuery
- XQuery Lab 52 – A More Intuitive way of reading an RDF document
- XQuery Lab 53 – Reading information from SQL Server Extended Event Information XML
- XQuery Lab 54 – Modifying an XML document with a SELECT Query
- XQuery Lab 55 – Extracting values from XML elements that matches a string pattern
- XQuery Lab 56 – Inserting elements with UNICODE values
- XQuery Lab 57 – Getting Started with OPENXML
- XQuery Lab 58 - SELECT * FROM XML
- XQuery Lab 59 – OPENXML() and XML Namespace Declarations
- XQuery Lab 60 – Executing dynamic query strings with OPENXML()
- XQuery Lab 61 – Writing a Recursive CTE to process an XML document
- XQuery Lab 62 – Revisiting simple TSQL SELECT operations using XQuery
- XQuery Lab 63 – Deleting empty elements from an XML document
- XQuery Lab 64 – Reading values from an XML column
浙公网安备 33010602011771号