Refactoring and static code analysis tool for SQL Server
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.

July 2008 - Posts

Service Broker - How can I put a message back into the queue, if my processing fails?

One of the questions that I had in my mind, when I started working with service broker is about the safety of my messages. Service broker is a reliable messaging platform. It is capable of delivering the message to the target without fail. But what if...
by Jacob Sebastian on 07-31-2008 | 41 Views

XQuery Lab 12 - Different ways of reading values from an XML variable

  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...
by Jacob Sebastian on 07-29-2008 | 1,012 Views

Service Broker - How to clean-up all open conversations and messages?

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...
by Jacob Sebastian on 07-29-2008 | 86 Views

Searching for a string in all procedures, views, functions, triggers etc

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...
by Jacob Sebastian on 07-28-2008 | 33 Views

XQuery Lab 11 - How to insert an element to an XML variable

  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"...
by Jacob Sebastian on 07-25-2008 | 962 Views

XQuery Lab 10 - How to insert an attribute to an XML variable

  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...
by Jacob Sebastian on 07-25-2008 | 1,003 Views

XQuery Lab 9 - How to delete an attribute from an XML variable?

  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 XML SELECT @x = '<Employee FirstName="Jacob" LastName="Sebastian"/>'...
by Jacob Sebastian on 07-25-2008 | 661 Views

Service Broker - Message Retention Demo

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...
by Jacob Sebastian on 07-25-2008 | 64 Views

XQuery Lab 8 - How to update the attribute value of an XML variable?

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...
by Jacob Sebastian on 07-24-2008 | 940 Views

Points to remember while Using Large Value Types [VARCHAR(MAX), NVARCHAR(MAX), VARBINARY(MAX) and XML]

In the previous post we have had a short discussion on using the Large Value Types. We have discussed a few points that might help while taking the decision to "go or not to go" with a Large Value type. The question I am trying to answer in...
by Jacob Sebastian on 07-22-2008 | 70 Views

When should I use large Value Types (VARCHAR(MAX), NVARCHAR(MAX), VARBINARY(MAX))

This is a question that I often hear from people around. Let us have a closer look into the various factors that help us to answer this question. One of the feeling that I see, many people have is "Hey, there is VARCHAR(MAX), just use it, and you...
by Jacob Sebastian on 07-21-2008 | 135 Views

Having vs Where: Which is better? Having or Where?

One of the points raised in the recent UG meeting was the question about HAVING and WHERE. So the question is, Which is better? HAVING or WHERE? Which one should I use? The question "which one should I use" is bit confusing because each operator...
by Jacob Sebastian on 07-20-2008 | 29 Views

TSQL - Use aliases always

Jamie Thomson has written a blog post showing problems of NOT using aliases and explains the advantages of using aliases. you can find the post here . I agree with Jamie and would like to invite all TSQL programmers to use table aliases always. Jamie...
by Jacob Sebastian on 07-14-2008 | 83 Views

XQuery Lab 7 - Extracting a comma separated list of values

This may be a very simple example. I don't know if this specific example would help anyone. However, the approach may give some of you a hint that can solve another problem that you may be trying to solve. In fact, the purpose of this whole series...
by Jacob Sebastian on 07-11-2008 | 863 Views

XQuery Lab 6 - Processing Header-Detail information

I came across a post in the MSDN SQL Server XML forum asking for some sample code that reads information from the XML instance and inserts it into two tables. At first glance, the request looked simple. But then I realized, that while inserting the information...
by Jacob Sebastian on 07-11-2008 | 809 Views

Copyright © Beyondrelational.com