<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>SQL Agents</title>
	<atom:link href="http://sqlagents.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sqlagents.wordpress.com</link>
	<description>Under the covers of SQL Server</description>
	<lastBuildDate>Sun, 14 Sep 2008 16:26:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sqlagents.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>SQL Agents</title>
		<link>http://sqlagents.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sqlagents.wordpress.com/osd.xml" title="SQL Agents" />
	<atom:link rel='hub' href='http://sqlagents.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Noise Words have been Silenced</title>
		<link>http://sqlagents.wordpress.com/2008/04/20/noise-words-have-been-silenced/</link>
		<comments>http://sqlagents.wordpress.com/2008/04/20/noise-words-have-been-silenced/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 20:10:51 +0000</pubDate>
		<dc:creator>Barry</dc:creator>
				<category><![CDATA[Full Text Search]]></category>
		<category><![CDATA[iFTS]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[STOPLISTS]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[full text indexes]]></category>
		<category><![CDATA[noise words]]></category>
		<category><![CDATA[stopwords]]></category>

		<guid isPermaLink="false">http://sqlagents.wordpress.com/?p=21</guid>
		<description><![CDATA[SQL Server 2008 introduces STOPLISTS as a replacement to the infamous Noise Word files. So, how easy is it to have your very own STOPLIST? Well, as it turns out very easy indeed. Although there are no tools as such for this, the T-SQL commands are very easy to use. So, first things first &#8211; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=21&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>SQL Server 2008 introduces STOPLISTS as a replacement to the infamous Noise Word files. So, how easy is it to have your very own STOPLIST? Well, as it turns out very easy indeed. Although there are no tools as such for this, the T-SQL commands are very easy to use.</p>
<p>So, first things first &#8211; I like to create my own company STOPLIST (the semi colon is required at the end):</p>
<p><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">CREATE </span></span></span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">FULLTEXT</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">STOPLIST</span></span><span style="font-size:x-small;"> MYSTOPLIST </span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">FROM</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">SYSTEM</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">STOPLIST</span></span><span style="font-size:x-small;color:#808080;"><span style="font-size:x-small;color:#808080;">;</span></span></p>
<p>Lets just make sure our STOPLIST has been created. We can do this simply by:</p>
<div><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#808080;"><span style="font-size:x-small;color:#808080;">SELECT *</span></span><span style="font-size:x-small;color:#000000;"> </span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">FROM</span></span><span style="font-size:x-small;color:#000000;"> </span><span style="font-size:x-small;color:#008000;"><span style="font-size:x-small;color:#008000;">sys</span></span><span style="font-size:x-small;color:#808080;"><span style="font-size:x-small;color:#808080;">.</span></span><span style="font-size:x-small;"><span style="color:#000000;">fulltext_stoplists</span></span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"> </span></span></span></span></span></span></span></span></span></span></span></span></div>
<div><span style="font-size:x-small;">What has that done for us then? Well, we created a new STOPLIST from the SYSTEM STOPLIST. So all the default STOPWORDS are included automatically. Er, Whats a STOPWORD? Well a STOPLIST contains one or more words that are called STOPWORDS. Each STOPWORD is associated with a LANGUAGE, so you can have a single STOPLIST which has all your STOPWORDS for each LANGUAGE you support. You might consider not basing your own STOPLIST on the system one as it will include ALL LANGUAGE&#8217;s STOPWORDS and on our test system here that means over 14K STOPWORDS.    </p>
<p></span></div>
<p><span style="font-size:x-small;">If you want to see a list of the STOPWORDS for your STOPLIST, you can run something like this (replace the STOPLIST_ID with your own and change the LANGUAGE if needed).</span></p>
<div><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"> </span></span></div>
<div><span style="font-size:x-small;color:#808080;"><span style="font-size:x-small;color:#808080;">SELECT *</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">FROM</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#008000;"><span style="font-size:x-small;color:#008000;">sys</span></span><span style="font-size:x-small;color:#808080;"><span style="font-size:x-small;color:#808080;">.</span></span><span style="font-size:x-small;">fulltext_stopwords<br />
</span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">WHERE<br />
</span></span><span style="font-size:x-small;">stoplist_id </span><span style="font-size:x-small;color:#808080;"><span style="font-size:x-small;color:#808080;">=</span></span><span style="font-size:x-small;"> 5<br />
</span><span style="font-size:x-small;color:#808080;"><span style="font-size:x-small;color:#808080;">AND<br />
</span></span><span style="font-size:x-small;">language_id </span><span style="font-size:x-small;color:#808080;"><span style="font-size:x-small;color:#808080;">=</span></span><span style="font-size:x-small;"> 2057</span></div>
<p><span style="font-size:x-small;">So, how do I add or remove STOPWORDS from my own STOPLIST? Again, this is really simple.</span></p>
<p>This script adds the STOPWORD &#8216;job&#8217; to the STOPLIST we created earlier. To confirm the STOPWORD was added, you can run the previous query. Note that the language is also specified.</p>
<p><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">ALTER </span></span></span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">FULLTEXT</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">STOPLIST </span></span><span style="font-size:x-small;"> MYSTOPLIST<br />
</span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">ADD</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;">&#8216;job&#8217;</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">LANGUAGE</span></span><span style="font-size:x-small;"> 2057;</span></span></span></span></span></span></p>
<p><span style="font-size:x-small;">To remove a STOPWORD , you would do this:</span></p>
<div><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"></p>
<div><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">ALTER</span></span></div>
<p></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">FULLTEXT</span></span><span style="font-size:x-small;color:#000000;"> </span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">STOPLIST</span></span><span style="font-size:x-small;"><span style="color:#000000;"> MYSTOPLIST<br />
</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">DROP</span></span><span style="font-size:x-small;color:#000000;"> </span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;">&#8216;b&#8217;</span></span><span style="font-size:x-small;color:#000000;"> </span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">LANGUAGE</span></span><span style="font-size:x-small;color:#000000;"> 2057</span><span style="font-size:x-small;color:#808080;"><span style="font-size:x-small;color:#808080;">;</span></span></p>
<p></span></p>
<p></span> </p>
<p></span></span></span></span></div>
<p>Now the only thing to say is that you need to specify your STOPLIST when you create your FULL TEXT INDEX. As its good practice to DROP and CREATE your Full Text Indexes in 2008 (if upgraded or restored from a 2005 database), this is not a problem either. I really like STOPLISTS, its another one of the simple enhancements in 2008 that although not a life changing feature it does make accessing another aspect of Full Text a lot easier.</p>
<p> </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sqlagents.wordpress.com/21/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sqlagents.wordpress.com/21/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlagents.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlagents.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlagents.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlagents.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlagents.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlagents.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlagents.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlagents.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlagents.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlagents.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlagents.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlagents.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlagents.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlagents.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=21&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlagents.wordpress.com/2008/04/20/noise-words-have-been-silenced/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/634cab94086b59e6231a6a8e6e302238?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Coolcoder</media:title>
		</media:content>
	</item>
		<item>
		<title>Database Snapshots: Quick as a Flash</title>
		<link>http://sqlagents.wordpress.com/2008/03/27/this/</link>
		<comments>http://sqlagents.wordpress.com/2008/03/27/this/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 09:57:35 +0000</pubDate>
		<dc:creator>nickallan</dc:creator>
				<category><![CDATA[DBA]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[Snapshots]]></category>
		<category><![CDATA[SQL 2005]]></category>

		<guid isPermaLink="false">http://sqlagents.wordpress.com/?p=20</guid>
		<description><![CDATA[The advent of SQL 2005 gave us the power of Database Snaphots. What are Snapshots? They&#8217;re just great! Someone with a lot more time than me has already written a detailed blog post on the subject: http://www.simple-talk.com/sql/database-administration/sql-server-2005-snapshots/. Unfortunately Management Studio did not come with GUI support for them, which is a real shame considering how [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=20&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The advent of SQL 2005 gave us the power of Database Snaphots.   What are Snapshots?  They&#8217;re <i>just great</i>!  Someone with a lot more time than me has already written a detailed blog post on the subject: <a href="http://www.simple-talk.com/sql/database-administration/sql-server-2005-snapshots/">http://www.simple-talk.com/sql/database-administration/sql-server-2005-snapshots/</a>.  Unfortunately Management Studio did not come with GUI support for them, which is a real shame considering how often I use them.</p>
<p>However, I have written a script which I keep as a SQL Server Template (easily accessible via Template Explorer).  Maybe it&#8217;s useful to you also..?</p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:green;">/*<br />
Description:           Script to create a Database Snapshot of the current database<br />
Author:                                   Nick Allan<br />
Date:                                       Mar 2008<br />
*/</span></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;">DECLARE</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';"> @Reference <span style="color:blue;">nvarchar</span><span style="color:gray;">(</span>10<span style="color:gray;">)</span></span></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;">SET</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> @Reference </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">=</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> &#8216;FBCXXXX&#8217;<br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--></span></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;">DECLARE @SQL nvarchar</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">(</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:fuchsia;">max</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;">), @SnapshotSuffix nvarchar</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">(</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;">100) ,@SnapshotName sysname<br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--></span></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;">SELECT</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';"> @SnapshotSuffix <span style="color:gray;">=</span> &#8216;_Snapshot_&#8217;<br />
<span style="color:gray;">+</span> <span style="color:fuchsia;">IsNull</span><span style="color:gray;">(</span>@Reference <span style="color:gray;">+</span> <span style="color:red;">&#8216;_&#8217;</span><span style="color:gray;">,</span> <span style="color:red;">&#8221;</span>)<br />
<span style="color:gray;">+</span> <span style="color:fuchsia;">Substring</span><span style="color:gray;">(</span><span style="color:fuchsia;">suser_name</span><span style="color:gray;">(),</span> <span style="color:fuchsia;">CharIndex</span><span style="color:gray;">(</span><span style="color:red;">&#8216;\&#8217;</span><span style="color:gray;">,</span> <span style="color:fuchsia;">suser_name</span><span style="color:gray;">())</span> <span style="color:gray;">+</span> 1<span style="color:gray;">,</span> <span style="color:fuchsia;">Len</span><span style="color:gray;">(</span><span style="color:fuchsia;">suser_name</span>())),<br />
@SnapshotName <span style="color:gray;">=</span> <span style="color:fuchsia;">DB_Name</span><span style="color:gray;">()</span> <span style="color:gray;">+</span> @SnapshotSuffix<br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--></span></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;">IF</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:fuchsia;">DB_ID</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">(</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;">@SnapshotName</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">)</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">IS</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">NOT</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">NULL<br />
</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"><br />
BEGIN<br />
</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;">PRINT</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> &#8216;&#8211;Database already exists&#8230;     DROP DATABASE &#8216;</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;"> </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">+</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;"> </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:fuchsia;">DB_Name</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">()</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;"> </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">+</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;"> @SnapshotSuffix<br />
RETURN<br />
END</span></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;"> SELECT</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> @SQL </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">=</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> &#8216;<br />
CREATE DATABASE &#8216; </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">+</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> @SnapshotName </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">+</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> &#8216;<br />
ON (<br />
NAME = &#8216; </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">+</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> [name] </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">+</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> &#8216;,<br />
FILENAME = &#8221;&#8217; </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">+</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">LEFT(</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;">physical_name</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">,</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:fuchsia;">Len</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">(</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;">physical_name</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">)</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">-</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> 4</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">)</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">+</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> @SnapshotSuffix </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">+</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;"> &#8216;.ss&#8221;<br />
)<br />
AS SNAPSHOT OF &#8216;</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';"> <span style="color:gray;">+</span> <span style="color:fuchsia;">DB_Name</span><span style="color:gray;">()</span></span></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:'Tahoma','sans-serif';">  <span style="color:blue;">FROM</span> sys.master_files<br />
<span style="color:blue;">WHERE</span> database_id <span style="color:gray;">=</span> <span style="color:fuchsia;">DB_ID</span>()   <span style="color:gray;">AND</span> <span style="color:blue;">type</span> <span style="color:gray;">=</span> 0 <span style="color:green;">&#8211;Data</span></span></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;"> BEGIN TRY<br />
EXEC </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">(</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;">@SQL)<br />
PRINT </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:red;">&#8216;Created DB snapshot: &#8216;</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;"> </span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:gray;">+</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;"> @SnapshotName<br />
END</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';"> <span style="color:blue;">TRY</span></span></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;">BEGIN</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';"> CATCH<br />
<span style="color:blue;">DECLARE</span> @ErrorMessage <span style="color:blue;">nvarchar</span><span style="color:gray;">(</span><span style="color:fuchsia;">max</span>),  @ErrorSeverity int<br />
<span style="color:blue;">SELECT</span> @ErrorMessage <span style="color:gray;">=</span> <span style="color:fuchsia;">ERROR_MESSAGE</span>(),  @ErrorSeverity <span style="color:gray;">=</span> <span style="color:fuchsia;">ERROR_SEVERITY</span><span style="color:gray;">()</span></span></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:'Tahoma','sans-serif';">  <span style="color:blue;">RAISERROR</span> ( @ErrorMessage,@ErrorSeverity,1 &#8211;Error State<br />
<span style="color:gray;">)</span></span></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;">PRINT @SQL<br />
END</span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';"> <span style="color:blue;">CATCH</span></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sqlagents.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sqlagents.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlagents.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlagents.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlagents.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlagents.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlagents.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlagents.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlagents.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlagents.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlagents.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlagents.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlagents.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlagents.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlagents.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlagents.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=20&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlagents.wordpress.com/2008/03/27/this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ad31210df824262bf7cd5e393f63c8a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nickallan</media:title>
		</media:content>
	</item>
		<item>
		<title>Properly Cleaning Up Dropped Subscriptions</title>
		<link>http://sqlagents.wordpress.com/2008/03/25/properly-cleaning-up-dropped-subscriptions/</link>
		<comments>http://sqlagents.wordpress.com/2008/03/25/properly-cleaning-up-dropped-subscriptions/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 13:14:55 +0000</pubDate>
		<dc:creator>Chirag</dc:creator>
				<category><![CDATA[Replication]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[Cleanup]]></category>
		<category><![CDATA[Drop]]></category>
		<category><![CDATA[Subscriber]]></category>
		<category><![CDATA[Subscription]]></category>

		<guid isPermaLink="false">http://sqlagents.wordpress.com/?p=19</guid>
		<description><![CDATA[If you are working in an environment utilising replication, you may find orphaned subscriptions show up on subscribers long after they have been dropped at the publisher. Well, why they aren&#8217;t cleared up when one drops a subscription or subsequently the publication itself.. you may ask&#8230; that&#8217;s a different question all together. You can run [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=19&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you are working in an environment utilising replication, you may find orphaned subscriptions show up on subscribers long after they have been dropped at the publisher. Well, why they aren&#8217;t cleared up when one drops a subscription or subsequently the publication itself.. you may ask&#8230; that&#8217;s a different question all together.</p>
<p>You can run a not so widely known command at the subscriber to clear out any orphaned subscriptions still listed on the subscribers. In fact, should I dare suggest it would actually be a great idea to implement this within your drop subscription process.</p>
<p>The command you can use is &#8220;<strong>sp_subscription_cleanup&#8221;. </strong> It has the following syntax:</p>
<p><strong>sp_subscription_cleanup </strong></p>
<p><strong></strong>[ <strong>@publisher = </strong>] <strong>&#8216;</strong><em>publisher</em><strong>&#8216;</strong> <strong>, </strong></p>
<p>[ <strong>@publisher_db = </strong>] <strong>&#8216;</strong><em>publisher_db</em><strong>&#8216;</strong></p>
<p>[ <strong>, </strong>[ <strong>@publication = </strong>] <strong>&#8216;</strong><em>publication</em><strong>&#8216;</strong>]<br />
where,</p>
<p>@publisher =&gt; is the name of the Publisher</p>
<p>@publisher_db =&gt; is the name of the Publisher database</p>
<p>@publication =&gt; is the name of the publication, with a default of NULL. If NULL, subscriptions using a shared agent publication in the publishing database will be deleted</p>
<p>At the Subscriber on the subscription database, execute sp_subscription_cleanup to remove replication metadata in the subscription database.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sqlagents.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sqlagents.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlagents.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlagents.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlagents.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlagents.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlagents.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlagents.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlagents.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlagents.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlagents.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlagents.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlagents.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlagents.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlagents.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlagents.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=19&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlagents.wordpress.com/2008/03/25/properly-cleaning-up-dropped-subscriptions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c13b69aaa28e216ca851b805341928e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Chirag</media:title>
		</media:content>
	</item>
		<item>
		<title>CTE&#8217;s&#8230;What are they and why would I ever want to use one?</title>
		<link>http://sqlagents.wordpress.com/2008/03/16/cteswhat-are-they-and-why-would-i-ever-want-to-use-one/</link>
		<comments>http://sqlagents.wordpress.com/2008/03/16/cteswhat-are-they-and-why-would-i-ever-want-to-use-one/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 16:52:37 +0000</pubDate>
		<dc:creator>sqlsurfer</dc:creator>
				<category><![CDATA[CTE]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[SQL 2005]]></category>

		<guid isPermaLink="false">http://sqlagents.wordpress.com/?p=15</guid>
		<description><![CDATA[CTE&#8217;s were a new introduction in SQL 2005 and even now we&#8217;re looking down the throat on SQL 2008 there are still many people who are unclear as to what CTE&#8217;s are, how they would use them and when. So what are they? CTE is short for Common Table Expression and is basically and expression [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=15&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>CTE&#8217;s were a new introduction in SQL 2005 and even now we&#8217;re looking down the throat on SQL 2008 there are still many people who are unclear as to what CTE&#8217;s are, how they would use them and when.</p>
<p><b>So what are they?</b></p>
<p>CTE is short for Common Table Expression and is basically and expression that returns a temporary result set inside of another statement.  In this way they are very similar to using a declared temporary table which you then reference. They are part of the ANSI SQL 99 standard and they are particularly useful for doing recursive queries.</p>
<p>A recursive query is one which can be said to call itself many times over.  An example would be a query which allows you to find the Manager and staff of every employee in a company. In the Adventure Works database the Employee table holds details for each employee and the ManagerId of the staff member they report to.  These managerid are self joined to the respective employeeid&#8217;s in the same table.  A CTE to find the information could look something like:</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">USE</span><span style="font-size:10pt;font-family:'Courier New';"> AdventureWorks <span style="color:gray;">;</span><br />
GO</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">WITH</span><span style="font-size:10pt;font-family:'Courier New';"> DirectReports<span style="color:gray;">(</span>LoginID<span style="color:gray;">,</span> ManagerID<span style="color:gray;">,</span> EmployeeID<span style="color:gray;">)</span> <span style="color:blue;">AS</span><br />
(</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';"><span>    </span><span style="color:blue;">SELECT</span> LoginID<span style="color:gray;">,</span> ManagerID<span style="color:gray;">,</span> EmployeeID<br />
<span>    </span><span style="color:blue;">FROM</span> HumanResources<span style="color:gray;">.</span>Employee<br />
<span>    </span><span style="color:blue;">WHERE</span> ManagerID <span style="color:gray;">IS</span> <span style="color:gray;">NULL</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';"><span>    </span><span style="color:blue;">UNION ALL</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';"><span>    </span><span style="color:blue;">SELECT</span> e<span style="color:gray;">.</span>LoginID<span style="color:gray;">,</span> e<span style="color:gray;">.</span>ManagerID<span style="color:gray;">,</span> e<span style="color:gray;">.</span>EmployeeID<br />
</span><span style="font-size:10pt;font-family:'Courier New';color:gray;"><span></span><span style="color:blue;">    FROM</span> HumanResources<span style="color:gray;">.</span>Employee e<br />
<span>    </span><span style="color:gray;">INNER</span> <span style="color:gray;">JOIN</span> DirectReports d<br />
<span>    </span><span style="color:blue;">ON</span> e<span style="color:gray;">.</span>ManagerID <span style="color:gray;">=</span> d<span style="color:gray;">.</span>EmployeeID<br />
)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:'Courier New';color:blue;">SELECT</span><span style="font-size:10pt;font-family:'Courier New';color:blue;"> <span style="color:gray;">*</span><br />
FROM</span><span style="font-size:10pt;line-height:115%;font-family:'Courier New';"> DirectReports <span style="color:gray;">;</span><br />
GO</span></p>
<p class="MsoNormal">This gives us the login ID, Manager Id and the EmployeeID for each user.</p>
<p class="MsoNormal">This statement can be broken down into three parts. The first is the &#8216;Root&#8217; or &#8216;Anchor Member&#8217; :</p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:'Courier New';"><span style="color:blue;">SELECT</span> LoginID<span style="color:gray;">,</span> ManagerID<span style="color:gray;">,</span> EmployeeID<br />
<span>    </span><span style="color:blue;">FROM</span> HumanResources<span style="color:gray;">.</span>Employee<br />
<span>    </span><span style="color:blue;">WHERE</span> ManagerID <span style="color:gray;">IS</span> <span style="color:gray;">NULL</span></span></p>
<p class="MsoNormal">This tells us our top, starting level in the hierarchy.</p>
<p class="MsoNormal">The second part is what makes the CTE recursive as it references itself using the join  : <span style="font-size:10pt;font-family:'Courier New';color:gray;"><span style="color:gray;">INNER</span> <span style="color:gray;">JOIN</span> DirectReports d<br />
<span>    </span><span style="color:blue;">ON</span> e<span style="color:gray;">.</span>ManagerID <span style="color:gray;">=</span> d<span style="color:gray;">.</span>EmployeeID</span></p>
<p class="MsoNormal">The statements are linked together by  a UNION</p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:'Courier New';"><span style="color:blue;">UNION ALL</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';"><span>    </span><span style="color:blue;">SELECT</span> e<span style="color:gray;">.</span>LoginID<span style="color:gray;">,</span> e<span style="color:gray;">.</span>ManagerID<span style="color:gray;">,</span> e<span style="color:gray;">.</span>EmployeeID<br />
</span><span style="font-size:10pt;font-family:'Courier New';color:gray;"><span></span><span style="color:blue;">    FROM</span> HumanResources<span style="color:gray;">.</span>Employee e<br />
<span>    </span><span style="color:gray;">INNER</span> <span style="color:gray;">JOIN</span> DirectReports d<br />
<span>    </span><span style="color:blue;">ON</span> e<span style="color:gray;">.</span>ManagerID <span style="color:gray;">=</span> d<span style="color:gray;">.</span>EmployeeID</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"> Finally we want to see our result set and this is done using the select statement:</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">SELECT</span><span style="font-size:10pt;font-family:'Courier New';color:blue;"> <span style="color:gray;">*</span><br />
FROM</span><span style="font-size:10pt;font-family:'Courier New';"> DirectReports <span style="color:gray;">;</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;">&nbsp;</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;">It is important to remember that the select statement must follow the CTE syntax immediatley.  Try running the following as an example of how this fails when not called immediately after the CTE:</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;">&nbsp;</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">USE</span><span style="font-size:10pt;font-family:'Courier New';"> AdventureWorks <span style="color:gray;">;</span><br />
GO</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">WITH</span><span style="font-size:10pt;font-family:'Courier New';"> DirectReports<span style="color:gray;">(</span>LoginID<span style="color:gray;">,</span> ManagerID<span style="color:gray;">,</span> EmployeeID<span style="color:gray;">)</span> <span style="color:blue;">AS</span><br />
(<br />
<span></span><span style="color:blue;">SELECT</span> LoginID<span style="color:gray;">,</span> ManagerID<span style="color:gray;">,</span> EmployeeID<br />
<span>    </span><span style="color:blue;">FROM</span> HumanResources<span style="color:gray;">.</span>Employee<br />
<span>    </span><span style="color:blue;">WHERE</span> ManagerID <span style="color:gray;">IS</span> <span style="color:gray;">NULL</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';"><span>    </span><span style="color:blue;">UNION ALL</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';"><span>    </span><span style="color:blue;">SELECT</span> e<span style="color:gray;">.</span>LoginID<span style="color:gray;">,</span> e<span style="color:gray;">.</span>ManagerID<span style="color:gray;">,</span> e<span style="color:gray;">.</span>EmployeeID<br />
</span><span style="font-size:10pt;font-family:'Courier New';color:gray;"><span></span><span style="color:blue;">    FROM</span> HumanResources<span style="color:gray;">.</span>Employee e<br />
<span>    </span><span style="color:gray;">INNER</span> <span style="color:gray;">JOIN</span> DirectReports d<br />
<span>    </span><span style="color:blue;">ON</span> e<span style="color:gray;">.</span>ManagerID <span style="color:gray;">=</span> d<span style="color:gray;">.</span>EmployeeID<br />
)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;">&nbsp;</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">SELECT </span><span style="font-size:10pt;font-family:'Courier New';"><span style="color:gray;">*</span> FROM HumanResources<span style="color:gray;">.</span>Employee</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:'Courier New';color:blue;">SELECT</span><span style="font-size:10pt;font-family:'Courier New';color:blue;"> <span style="color:gray;">*</span><br />
FROM</span><span style="font-size:10pt;line-height:115%;font-family:'Courier New';"> DirectReports <span style="color:gray;">;</span><br />
GO</span></p>
<p class="MsoNormal"> The following error is thrown:</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span style="font-size:8pt;line-height:115%;font-family:'Courier New';">Msg 208, Level 16, State 1, Line 15<br />
Invalid object name &#8216;DirectReports&#8217;.</span></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">CTE&#8217;s are just another weapon in the developers arsenal.  There will be times when it is appropriate to use them and times when there is a better solution.  I recently read a great article by Peter He about the performance implications of using CTE against general looping constructs. Its worth a read and can be found <a href="http://www.sqlservercentral.com/articles/T-SQL/2926/" title="CTE Performance" target="_blank">here</a>.</p>
<p class="MsoNormal">&nbsp;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sqlagents.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sqlagents.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlagents.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlagents.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlagents.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlagents.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlagents.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlagents.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlagents.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlagents.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlagents.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlagents.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlagents.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlagents.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlagents.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlagents.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=15&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlagents.wordpress.com/2008/03/16/cteswhat-are-they-and-why-would-i-ever-want-to-use-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05e240711dc800ce3e3d852a8e0ced17?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqlsurfer</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL 2008 MERGE Functionality</title>
		<link>http://sqlagents.wordpress.com/2008/03/11/sql-2008-merge-funtionality/</link>
		<comments>http://sqlagents.wordpress.com/2008/03/11/sql-2008-merge-funtionality/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 13:05:07 +0000</pubDate>
		<dc:creator>sqlsurfer</dc:creator>
				<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[MERGE]]></category>
		<category><![CDATA[sql 2008]]></category>

		<guid isPermaLink="false">http://sqlagents.wordpress.com/?p=9</guid>
		<description><![CDATA[One of the new SQL 2008 T-SQL features is MERGE. The great thing about MERGE is it allows you to perform simultaneous UPDATE, INSERT and or DELETE operations on one table. Its supported by new physical operators that combine these operations so that they can be performed in a single scan rather than multiple scans. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=9&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the new SQL 2008 T-SQL features is MERGE.</p>
<p>The great thing about MERGE is it allows you to perform simultaneous UPDATE, INSERT and or DELETE operations on one table. Its supported by new physical operators that combine these operations so that they can be performed in a single scan rather than multiple scans.</p>
<p>This means that for the first time you can assign the contents of one table or query to another in a single operation</p>
<p class="MsoNormal">Here&#8217;s a small example which uses a stored proc:</p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:'Tahoma','sans-serif';color:blue;"></span><span style="font-size:8pt;font-family:'Tahoma','sans-serif';"><br />
</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:green;">/********Lets create the table object*******/</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">IF</span><span style="font-size:10pt;font-family:'Courier New';"> <span style="color:fuchsia;">OBJECT_ID</span><span style="color:gray;">(</span><span style="color:red;">&#8216;TeamMember&#8217;</span><span style="color:gray;">)</span> <span style="color:gray;">IS</span> <span style="color:gray;">NOT</span> <span style="color:gray;">NULL</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">BEGIN<br />
DROP</span><span style="font-size:10pt;font-family:'Courier New';color:blue;"> <span style="color:blue;">TABLE</span> TeamMember<br />
END</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';">GO</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">CREATE</span><span style="font-size:10pt;font-family:'Courier New';"> <span style="color:blue;">TABLE</span> TeamMember</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:gray;">(</span></p>
<blockquote>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';">EmpId <span style="color:blue;">INT</span> <span style="color:blue;">PRIMARY</span> <span style="color:blue;">KEY</span> <span style="color:blue;">IDENTITY</span> <span style="color:gray;">(</span>1<span style="color:gray;">,</span>1<span style="color:gray;">),</span></span></p>
</blockquote>
<blockquote>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';">FirstName <span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span>200<span style="color:gray;">),</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';">LastName <span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span>200<span style="color:gray;">),</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';">Department <span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span>200<span style="color:gray;">)</span></span></p>
</blockquote>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:gray;">)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';">GO</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:green;">/********Insert some Team Members*******/<br />
/********here using the new insert multi row functionality available in 2008*******/</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">INSERT</span><span style="font-size:10pt;font-family:'Courier New';color:blue;"> <span style="color:blue;">INTO</span> TeamMember <span style="color:gray;">(</span>FirstName<span style="color:gray;">,</span>LastName<span style="color:gray;">,</span>Department<span style="color:gray;">)</span><br />
VALUES</span></p>
<blockquote>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:gray;">(</span><span style="font-size:10pt;font-family:'Courier New';color:red;">&#8216;James&#8217;</span><span style="font-size:10pt;font-family:'Courier New';color:gray;">,</span><span style="font-size:10pt;font-family:'Courier New';color:red;">&#8216;Hill&#8217;</span><span style="font-size:10pt;font-family:'Courier New';color:gray;">,</span><span style="font-size:10pt;font-family:'Courier New';color:red;">&#8216;IT&#8217;</span><span style="font-size:10pt;font-family:'Courier New';color:gray;">),</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:gray;">(</span><span style="font-size:10pt;font-family:'Courier New';color:red;">&#8216;Sarah&#8217;</span><span style="font-size:10pt;font-family:'Courier New';color:gray;">,</span><span style="font-size:10pt;font-family:'Courier New';color:red;">&#8216;Parker&#8217;</span><span style="font-size:10pt;font-family:'Courier New';color:gray;">,</span><span style="font-size:10pt;font-family:'Courier New';color:red;">&#8216;Sales&#8217;</span><span style="font-size:10pt;font-family:'Courier New';color:gray;">),</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:gray;">(</span><span style="font-size:10pt;font-family:'Courier New';color:red;">&#8216;Nick&#8217;</span><span style="font-size:10pt;font-family:'Courier New';color:gray;">,</span><span style="font-size:10pt;font-family:'Courier New';color:red;">&#8216;Thompson&#8217;</span><span style="font-size:10pt;font-family:'Courier New';color:gray;">,</span><span style="font-size:10pt;font-family:'Courier New';color:red;">&#8216;Marketing&#8217;</span><span style="font-size:10pt;font-family:'Courier New';color:gray;">)</span></p>
</blockquote>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';">GO</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:green;">/********Create a procedure that might do some Team Member admin in ‘the REAL world’ !*******/</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">IF</span><span style="font-size:10pt;font-family:'Courier New';color:blue;"> <span style="color:fuchsia;">OBJECT_ID</span><span style="color:gray;">(</span><span style="color:red;">&#8216;up_InsertTeamMember&#8217;</span><span style="color:gray;">)</span> <span style="color:gray;">IS</span> <span style="color:gray;">NOT</span> <span style="color:gray;">NULL</span><br />
BEGIN<br />
DROP</span><span style="font-size:10pt;font-family:'Courier New';color:blue;"> <span style="color:blue;">PROCEDURE</span> up_InsertTeamMember<br />
END</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';">GO</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">CREATE</span><span style="font-size:10pt;font-family:'Courier New';color:gray;"> <span style="color:blue;">PROCEDURE</span> up_InsertTeamMember<br />
(<br />
</span></p>
<blockquote><p><span style="font-size:10pt;font-family:'Courier New';color:gray;">@FirstName <span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span>200<span style="color:gray;">),</span></span><br />
<span style="font-size:10pt;font-family:'Courier New';color:gray;">@LastName <span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span>200<span style="color:gray;">),</span></span><br />
<span style="font-size:10pt;font-family:'Courier New';color:gray;">@Department <span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span>200<span style="color:gray;">),</span></span><br />
<span style="font-size:10pt;font-family:'Courier New';color:gray;">@EmpId <span style="color:blue;">INT</span> <span style="color:blue;">OUTPUT</span></span><br />
<span style="font-size:10pt;font-family:'Courier New';color:gray;"></span></p></blockquote>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:gray;">)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">AS</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">BEGIN<br />
</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">/********Lets do the MERGE here*******/<br />
MERGE</span><span style="font-size:10pt;font-family:'Courier New';color:blue;"> TeamMember<br />
USING <span style="color:gray;">(</span><span style="color:blue;">SELECT</span> @FirstName<span style="color:gray;">,</span>@LastName<span style="color:gray;">)</span><br />
tm <span style="color:gray;">(</span>FirstName<span style="color:gray;">,</span>LastName<span style="color:gray;">)</span><br />
ON</span><span style="font-size:10pt;font-family:'Courier New';"> TeamMember<span style="color:gray;">.</span>FirstName <span style="color:gray;">=</span> @FirstName <span style="color:gray;">AND</span><br />
TeamMember<span style="color:gray;">.</span>LastName <span style="color:gray;">=</span> @LastName</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:green;">/********If its not there lets create a new Team Member*******/</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">WHEN</span><span style="font-size:10pt;font-family:'Courier New';color:blue;"> <span style="color:gray;">NOT</span> MATCHED <span style="color:blue;">THEN</span><br />
INSERT</span><span style="font-size:10pt;font-family:'Courier New';color:blue;"> <span style="color:gray;">(</span>FirstName<span style="color:gray;">,</span>LastName<span style="color:gray;">,</span>Department<span style="color:gray;">)</span><br />
VALUES</span><span style="font-size:10pt;font-family:'Courier New';"> <span style="color:gray;">(</span>@FirstName<span style="color:gray;">,</span>@LastName<span style="color:gray;">,</span>@Department<span style="color:gray;">)</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:green;">/********If it is there lets just set the existing id to the ouput variable*******/</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">WHEN</span><span style="font-size:10pt;font-family:'Courier New';color:blue;"> MATCHED <span style="color:blue;">THEN</span><br />
UPDATE</span><span style="font-size:10pt;font-family:'Courier New';"> <span style="color:blue;">SET</span> @EmpId<span style="color:gray;">=</span>EmpId<span style="color:gray;">,</span>Department <span style="color:gray;">=</span> @Department<span style="color:gray;">;</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">/********Grab the new ID*******/<br />
SET</span><span style="font-size:10pt;font-family:'Courier New';"> @EmpID <span style="color:gray;">=</span> <span style="color:fuchsia;">COALESCE</span><span style="color:gray;">(</span><span style="color:fuchsia;">SCOPE_IDENTITY</span><span style="color:gray;">(),</span>@EmpID<span style="color:gray;">);</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">END</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">RETURN</span><span style="font-size:10pt;font-family:'Courier New';color:gray;">;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';">go</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:green;">/********Heres the procedure, try adding a new memberand then a team member with the same FirstName and LastName but different department*******/</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">DECLARE</span><span style="font-size:10pt;font-family:'Courier New';"> @EmpId <span style="color:blue;">INT</span><span style="color:gray;">,</span>@Message <span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span>100<span style="color:gray;">)</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">EXEC</span><span style="font-size:10pt;font-family:'Courier New';"> up_InsertTeamMember @FirstName <span style="color:gray;">=</span> <span style="color:red;">&#8216;James&#8217;</span><span style="color:gray;">,</span>@LastName <span style="color:gray;">=</span> <span style="color:red;">&#8216;Smith&#8217;</span><span style="color:gray;">,</span>@Department <span style="color:gray;">=</span> <span style="color:red;">&#8216;Sales&#8217;</span><span style="color:gray;">,</span>@EmpId <span style="color:gray;">=</span> @EmpId <span style="color:blue;">OUTPUT</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">PRINT</span><span style="font-size:10pt;font-family:'Courier New';"> @EmpId</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';">GO</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">SELECT</span><span style="font-size:10pt;font-family:'Courier New';"> <span style="color:gray;">*</span> <span style="color:blue;">FROM</span> TeamMember</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:'Courier New';">GO</span></p>
<p class="MsoNormal">&nbsp;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sqlagents.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sqlagents.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlagents.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlagents.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlagents.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlagents.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlagents.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlagents.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlagents.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlagents.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlagents.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlagents.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlagents.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlagents.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlagents.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlagents.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=9&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlagents.wordpress.com/2008/03/11/sql-2008-merge-funtionality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05e240711dc800ce3e3d852a8e0ced17?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqlsurfer</media:title>
		</media:content>
	</item>
		<item>
		<title>Insert multiple rows</title>
		<link>http://sqlagents.wordpress.com/2008/03/10/insert-multiple-rows/</link>
		<comments>http://sqlagents.wordpress.com/2008/03/10/insert-multiple-rows/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 14:41:45 +0000</pubDate>
		<dc:creator>Barry</dc:creator>
				<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[multiple row insert]]></category>
		<category><![CDATA[row constructor]]></category>
		<category><![CDATA[single statement]]></category>
		<category><![CDATA[sql 2008]]></category>

		<guid isPermaLink="false">http://sqlagents.wordpress.com/2008/03/10/insert-multiple-rows/</guid>
		<description><![CDATA[How many times have we had to write multiple INSERT INTO statements? Well, SQL Server 2008 comes to the rescue. Its a small feature but still very useful. You can now insert multiple rows into a table in a single statement. INSERT INTO T1 (Col1,Col2,Col3) VALUES (&#8216;Row1&#8242;, &#8216;Value&#8217;,&#8216;Test&#8217;), (&#8216;Row2&#8242;, &#8216;Value&#8217;,&#8216;Test&#8217;), (&#8216;Row3&#8242;, &#8216;Value&#8217;,&#8216;Test&#8217;) This inserts 3 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=7&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How many times have we had to write multiple INSERT INTO statements? Well, SQL Server 2008 comes to the rescue. Its a small feature but still very useful.</p>
<p>You can now insert multiple rows into a table in a single statement.</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:'Courier New';color:blue;">INSERT</span><span style="font-size:10pt;font-family:'Courier New';color:blue;"> <span style="color:blue;">INTO</span> T1 <span style="color:gray;">(</span>Col1<span style="color:gray;">,</span>Col2<span style="color:gray;">,</span>Col3<span style="color:gray;">)</span><br />
VALUES</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:'Courier New';"><span> </span><span style="color:gray;">(</span><span style="color:red;">&#8216;Row1&#8242;</span><span style="color:gray;">,</span> <span style="color:red;">&#8216;Value&#8217;</span><span style="color:gray;">,</span><span style="color:red;">&#8216;Test&#8217;</span><span>),<br />
</span><span style="color:gray;">(</span><span style="color:red;">&#8216;Row2&#8242;</span><span style="color:gray;">,</span> <span style="color:red;">&#8216;Value&#8217;</span><span style="color:gray;">,</span><span style="color:red;">&#8216;Test&#8217;</span><span>),<br />
</span><span style="color:gray;">(</span><span style="color:red;">&#8216;Row3&#8242;</span><span style="color:gray;">,</span> <span style="color:red;">&#8216;Value&#8217;</span><span style="color:gray;">,</span><span style="color:red;">&#8216;Test&#8217;</span><span style="color:gray;">)</span></span></p>
<p class="MsoNormal">This inserts 3 rows into the T1 table. Certainly time-saving and makes those sometimes hefty insert scripts smaller.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sqlagents.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sqlagents.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlagents.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlagents.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlagents.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlagents.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlagents.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlagents.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlagents.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlagents.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlagents.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlagents.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlagents.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlagents.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlagents.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlagents.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=7&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlagents.wordpress.com/2008/03/10/insert-multiple-rows/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/634cab94086b59e6231a6a8e6e302238?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Coolcoder</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Bits II</title>
		<link>http://sqlagents.wordpress.com/2008/03/09/sql-bits-ii/</link>
		<comments>http://sqlagents.wordpress.com/2008/03/09/sql-bits-ii/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 11:25:07 +0000</pubDate>
		<dc:creator>sqlsurfer</dc:creator>
				<category><![CDATA[SQL Community]]></category>
		<category><![CDATA[SQLBits]]></category>

		<guid isPermaLink="false">http://sqlagents.wordpress.com/?p=6</guid>
		<description><![CDATA[Last Saturday (1st March 2008) was the second SQL Bits meet, this time in Birmingham.  Once again it turned out to be a great event with interesting speakers and all for the grand price of&#8230;zilch!! So I would personally like to extend my thanks for everyone that helped put it together and I look forward [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=6&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last Saturday (1st March 2008) was the second <a href="http://www.SQLBits.com" title="SQLBits" target="_blank">SQL Bits</a> meet, this time in Birmingham.  Once again it turned out to be a great event with interesting speakers and all for the grand price of&#8230;zilch!!</p>
<p>So I would personally like to extend my thanks for everyone that helped put it together and I look forward to the next one.</p>
<p>I notice that Chris Webb has set up a <a href="http://www.sqlbits.com" title="SQLBits" target="_blank">SQL Bits</a> <a href="http://www.facebook.com" title="FaceBook" target="_blank">Facebook </a>group so for those on FB, check that out.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sqlagents.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sqlagents.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlagents.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlagents.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlagents.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlagents.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlagents.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlagents.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlagents.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlagents.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlagents.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlagents.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlagents.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlagents.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlagents.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlagents.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=6&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlagents.wordpress.com/2008/03/09/sql-bits-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05e240711dc800ce3e3d852a8e0ced17?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqlsurfer</media:title>
		</media:content>
	</item>
		<item>
		<title>Activation Procedure Being Disabled</title>
		<link>http://sqlagents.wordpress.com/2008/03/07/activation-procedure-being-disabled/</link>
		<comments>http://sqlagents.wordpress.com/2008/03/07/activation-procedure-being-disabled/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 20:09:43 +0000</pubDate>
		<dc:creator>sqlsurfer</dc:creator>
				<category><![CDATA[Service Broker]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[activation]]></category>
		<category><![CDATA[CLR]]></category>
		<category><![CDATA[procedure]]></category>

		<guid isPermaLink="false">http://sqlagents.wordpress.com/2008/03/07/activation-procedure-being-disabled/</guid>
		<description><![CDATA[Today I had a situation where Service Broker appeared to be running successfully but the activation procedure was not being called and no receive processes were being seen in Profiler. It turned out that the activation procedure had &#8216;switched off&#8217; although there was nothing I could see that indicated this other than the lack of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=5&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I had a situation where Service Broker appeared to be running successfully but the activation procedure was not being called and no receive processes were being seen in Profiler. It turned out that the activation procedure had &#8216;switched off&#8217; although there was nothing I could see that indicated this other than the lack of activity. The process was restarted by simpling calling the activation procedure from MS.</p>
<p>The problem in my scenario started when the broker attempted to run a CLR function on a box on which CLR was not enabled (doh!) and by the time this had been enabled and the queue had grown significantly, the activation procedure had shut down.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sqlagents.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sqlagents.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlagents.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlagents.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlagents.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlagents.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlagents.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlagents.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlagents.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlagents.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlagents.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlagents.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlagents.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlagents.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlagents.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlagents.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=5&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlagents.wordpress.com/2008/03/07/activation-procedure-being-disabled/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05e240711dc800ce3e3d852a8e0ced17?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqlsurfer</media:title>
		</media:content>
	</item>
		<item>
		<title>Service Broker Deployment Numero Uno!</title>
		<link>http://sqlagents.wordpress.com/2008/03/07/service-broker-deployment-numero-uno/</link>
		<comments>http://sqlagents.wordpress.com/2008/03/07/service-broker-deployment-numero-uno/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 20:08:47 +0000</pubDate>
		<dc:creator>sqlsurfer</dc:creator>
				<category><![CDATA[Service Broker]]></category>
		<category><![CDATA[broker]]></category>
		<category><![CDATA[CLR]]></category>
		<category><![CDATA[queues]]></category>
		<category><![CDATA[Replication]]></category>

		<guid isPermaLink="false">http://sqlagents.wordpress.com/2008/03/07/service-broker-deployment-numero-uno/</guid>
		<description><![CDATA[We have just deployed my first Service Broker project to the live environment and touch wood everything appears to have gone ok. Sure it took a little massaging to get it through and we certainly learned a few things along the way but thats all part of it right. Working for a well known job [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=4&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We have just deployed my first Service Broker project to the live environment and touch wood everything appears to have gone ok. Sure it took a little massaging to get it through and we certainly learned a few things along the way but thats all part of it right.</p>
<p>Working for a well known job board we are using service broker in conjunction with SQL CLR to do asynnchronous string manipulations to job adverts.  Orignally this was something we did through replication but it became clear very quickly that fast as CLR is, replication latency would be effected.  So instead we had a re-think and moved the process offline.  We&#8217;re sure that there are many other applications for Service Broker within our business now.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sqlagents.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sqlagents.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlagents.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlagents.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlagents.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlagents.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlagents.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlagents.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlagents.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlagents.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlagents.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlagents.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlagents.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlagents.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlagents.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlagents.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=4&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlagents.wordpress.com/2008/03/07/service-broker-deployment-numero-uno/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05e240711dc800ce3e3d852a8e0ced17?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqlsurfer</media:title>
		</media:content>
	</item>
		<item>
		<title>Service Broker Terminology (A Quick Guide)</title>
		<link>http://sqlagents.wordpress.com/2008/03/07/service-broker-terminology-a-quick-guide/</link>
		<comments>http://sqlagents.wordpress.com/2008/03/07/service-broker-terminology-a-quick-guide/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 20:07:02 +0000</pubDate>
		<dc:creator>sqlsurfer</dc:creator>
				<category><![CDATA[Service Broker]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[2005]]></category>
		<category><![CDATA[asynchronous]]></category>
		<category><![CDATA[broker]]></category>
		<category><![CDATA[conversations]]></category>
		<category><![CDATA[initiator]]></category>
		<category><![CDATA[queues]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[target]]></category>

		<guid isPermaLink="false">http://sqlagents.wordpress.com/?p=3</guid>
		<description><![CDATA[Microsoft&#8217;s new Service Broker feature in SQL 2005 introduces a number of new concepts, processes and terminology which for some may make the idea of using Service Broker a little daunting. On this site we hope to ease some of that pain by giving our thoughts, examples and explanations on the platform. To start with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=3&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Microsoft&#8217;s new Service Broker feature in SQL 2005 introduces a number of new concepts, processes and terminology which for some may make the idea of using Service Broker a little daunting. On this site we hope to ease some of that pain by giving our thoughts, examples and explanations on the platform.</p>
<p>To start with lets have a look at some of the terminology which may be new to many.</p>
<p><b>A</b>:</p>
<blockquote><p><b><b>Asynchronous</b></b></p>
<p>Asynchronous in process terms means a task which can continue independently &#8220;in the background&#8221;. Other processes may be started before the asynchronous process has finished.</p>
<p>In Service Broker this means that we can effectively decouple messages from the processes that initiated them. A sending process can send a message and then continue to completion or start a number of other processes without ever having to know the status of the sent message. This could be particularly useful if you use multiple systems that may not function at the same speed. The faster initiating system could start a process in a &#8216;fire and forget&#8217; manner allowing the slower system to process at its own speed.</p></blockquote>
<p><b>C: </b></p>
<blockquote><p><b>Contracts </b></p>
<p>A contract is an agreement between two endpoints within a Service Broker conversation. It determines what type of messages can be sent and who can send them. To preserve its integrity, once a contract is defined its list of message typ0e cannot be changed.</p>
<p><b>Conversation </b></p>
<p>A conversation in the context of Service Broker is defined as a reliable, ordered and asynchronous transfer of messages between conversation endpoints. Conversations can be either dialog or monolog, however in 2005, monolog conversations were taken out, but will likely be included in a future release. Service Broker will continue trying to deliver a message irrespective of database or network failure hence reliability. In terms of ordering, Service Broker will ensure that messages sent on the same conversation will be delivered and processed in the order in which they were sent. This could be particularly important in multi-threaded environments or where payload size or complexity exists.</p></blockquote>
<p><b>D:</b></p>
<blockquote><p><b>Dialogs</b></p>
<p>A dialog conversation, or dialog, is a conversation between two services</p>
<p>The lifetime of a dialog lasts from the time that the local SQL Server instance creates the dialog until an application either explicitly ends the dialog or receives an error message associated with the dialog. Each participant is responsible for explicitly ending the conversation when the application receives a message that indicates an error or the end of the conversation. In most services, one participant is responsible for indicating that the conversation is complete and successful by ending the conversation without an error. Whether this is done by the target or the initiator depends on the purpose of the conversation.</p></blockquote>
<p><b>E:</b></p>
<blockquote><p><b>Endpoints</b></p>
<p>Endpoints are used to allow Service Broker to send and receive messages across a network. Out of the box an installed instance of SQL Server will not contain any Service Broker Endpoints for security reasons. In order to use Service Broker you must first create an endpoint.</p></blockquote>
<p><b>G:</b></p>
<blockquote><p><b>Groups </b>(as in conversation groups)</p>
<p>Every conversation is associated with a conversation group. When a message is sent or received the conversation group is locked to stop any other messages can be sent on it until the transaction holding the lock completes. This ensures that even with many queue readers active a conversation can only be accessed by one queue reader at any one time.</p></blockquote>
<p><b>M:</b></p>
<blockquote><p><b>Messages</b></p>
<p>Messages are as you might expect, the payload or information that is being exchanged during a conversation. This information is divided into two parts, one being the message header and the other being the message itself.</p>
<p>The header contains information about he message such as the message type. This is a kind of descriptor for the message that is being relayed.</p>
<p>The message body is a VARBINARY(MAX) datatype which can contain up to 2GB or data. This data can be of any SQL datatype that can be cast to VARBINARY(MAX)</p></blockquote>
<p><b>Q:</b></p>
<blockquote><p><b>Queues</b></p>
<p>Queues are one of the ways that Service Broker manages the work being transmitted, by storing it in the database. In the same way as other queues manage data or objects it allows items to be stacked up in order by an initiating process which can then move on to another task. Many people have probably used some kind of process table in sql server to manage data, one process puts it on and another pulls it off. This is the same idea.</p>
<p>These queue tables are hidden system tables but there are system views that will allow you to read the data.</p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sqlagents.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sqlagents.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlagents.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlagents.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlagents.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlagents.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlagents.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlagents.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlagents.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlagents.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlagents.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlagents.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlagents.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlagents.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlagents.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlagents.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlagents.wordpress.com&amp;blog=3092027&amp;post=3&amp;subd=sqlagents&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlagents.wordpress.com/2008/03/07/service-broker-terminology-a-quick-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05e240711dc800ce3e3d852a8e0ced17?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqlsurfer</media:title>
		</media:content>
	</item>
	</channel>
</rss>
