|
|
-
|
|
In XQuery Lab 18, we saw how to delete an element from an XML variable or column. Let us now see, how to delete more than one element from an XML column or variable.
Here is the sample XML that we will examine in this lab.
Employees><br /> Employee><br /> ......
|
|
-
|
|
I heard this question from many people. Executing a dynamic OPENXML() query is little tricky.
Before we look at a dynamic OPENXML() query, let us look at the static version. Here is an example document that we will parse using OPENXML() in this session.
Employees><br /> Employee <span st......
|
|
-
|
|
We have seen a number of string parsing/manipulating examples using XQuery and FOR XML in the previous sessions of XQuery Labs. This session presents yet another string parsing example using XML data type methods.
Here is the string value that we need to parse.
'id1-s1,s2,s3|id2-s4,s5,s6|id3......
|
|
-
|
|
I found this question in the MSDN SQL Server XML forum and wrote a query to help the user who posted it. I wanted to write a query using XQuery but could not write it instantly. There does not seem to be an easy way to get the full path of an element or attribute. One option I can think of, is writi......
|
|
-
|
|
The first time I came across this question is when I started writing the TSQL function to compare two XML values. Let us see how to count the attributes an element has. Here is the XML value that we will use for the examples in this lab. Employees Dept<span style=......
|
|
-
|
|
Well, this is yet another question we need to answer before we could write the TSQL function to compare two XML values. Let us look at an XML instance. Employees><br /> Employee<span s......
|
|
-
|
|
Most of the times we need only to read values from elements. However, there may be times when you need to read the name of elements as well. We came across this requirement when we started writing the TSQL function that compares two XML values, in the previous post. The following example sh......
|
|
-
|
|
It is easy to read information when we know the name of the element to be processed. In this post, let us examine how to read values from elements using wildcards. This is one of the functionality we needed to write the function we wanted to write in the previous post, to compare two XML val......
|
|
-
|
|
Many people asked me if there is a to compare two XML values in TSQL. And my answer always was "there is not support in TSQL". Comparing two XML values is not very easy. Some people suggest using a CHECKSUM() but that does not seem to be giving correct results. Position of attrib......
|
|
-
|
|
We have seen the usage of XQuery function "local-name()" in one of the previous posts. This function is very helpful when you don't know the element or attribute to process. The calling process can specify an element or attribute name in a variable and you can perform an operation ......
|
|