|
|
-
|
|
In the previous post, we have had a detailed look into 3 methods exposed by the HIERARCHYID data type. We have examined GetAncestor(), GetRoot() and GetLevel(). In this post, we will see some examples that demonstrate the usage of a few more methods. Ge...
|
|
-
|
|
We all know that there are different ways you can write a query to retrieve a piece of information from one or more tables. XQuery is a rich query language and you can write an XQuery expression in a number of ways to retrieve a certain information. I will show you a few examples in this pos......
|
|
-
|
|
These days, I am spending some time with Service Broker, testing various features exposed by SB. Many times, I am finding errors (due to my bad code) which results in dialog-conversations that are not closed, messages that are not processed etc. So, before testing something new, I needed a way to do......
|
|
-
|
|
I wrote a query a few years back to search for a given string in all stored procedures, functions, triggers, views etc. I had been using it whenever I needed to search within all the database objects. I had written a blog post about it a few years back. The query is quite simple.
SELECT ......
|
|
-
|
|
In the previous post we have seen how to insert an attribute to an XML variable. In this post, let us see how to insert an element to an XML variable. In the example given below, an element named "LastName" is added to the "Employee" element. DECLARE @x XMLSELECT @x =......
|
|
-
|
|
We have seen how to update the value of an attribute and how to delete an attribute from an XML variable. Let us now see how to insert an attribute to an XML variable. We could do this by using the modify() method of XML data type. Note that XQuery methods are case sensitive. The following......
|
|
-
|
|
In the previous lab we saw how to update the value of an attribute. Now let us see how to delete an attribute from an XML variable. DECLARE @x XMLSELECT @x = ''<span style="color:......
|
|
-
|
|
When you create a queue with RETENTION set to ON, Service Broker will keep the message in the queue until the conversation ends. When this is set to OFF, a message is removed from the queue when you retrieve it using RECEIVE command. When RETENTION is set to ON Service Broker keeps the message in th......
|
|
-
|
|
I just heard this question from a co-worker and wrote a small piece of sample code for him. Just wanted to share it with all of you. The following code snippet shows an example that updates the value of an attribute. The XML fragment contains information of an employee and we are trying to update ......
|
|
-
|
|
If you are using SQL Server 2008 RC0 and try to run a piece of code written with the previous version, using the Reparent() method of HIERARCHYID data type, you will get the following error:Could not find method 'Reparent' for type 'Microsoft.SqlServer....
|
|