<?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/"
	>

<channel>
	<title>Development Blog &#187; Service Broker</title>
	<atom:link href="http://blog.yeticode.co.uk/tag/service-broker/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.yeticode.co.uk</link>
	<description>John Tindell's Blog For Development Related Things</description>
	<lastBuildDate>Wed, 23 Jun 2010 18:17:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>SQL Service Broker</title>
		<link>http://blog.yeticode.co.uk/2009/02/sql-service-broker/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=sql-service-broker</link>
		<comments>http://blog.yeticode.co.uk/2009/02/sql-service-broker/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 17:44:47 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Service Broker]]></category>

		<guid isPermaLink="false">http://blog.yeticode.co.uk/?p=55</guid>
		<description><![CDATA[After trying to receive a message from a service broker queue for a while I found that it will not throw an error if your database isn&#8217;t setup correctly. After looking in the table where the messages are stored before they are sent to the queue the solution was easily found The Error An exception [...]]]></description>
			<content:encoded><![CDATA[<p>After trying to receive a message from a service broker queue for a while I found that it will not throw an error if your database isn&#8217;t setup correctly. After looking in the table where the messages are stored before they are sent to the queue the solution was easily found</p>
<p><strong>The Error</strong></p>
<pre name="code" class="sql">An exception occurred while enqueueing a message in the target queue. Error: 15517, State: 1. Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission.</pre>
<p>Where messages are stored before they are sent to queue, and any exceptions which occurred</p>
<pre name="code" class="sql">
select * from sys.transmission_queue
</pre>
<p><strong>Fix</strong></p>
<pre name="code" class="sql">
USE [database_name]
ALTER DATABASE [database_name]SET TRUSTWORTHY ON
ALTER DATABASE [database_name] SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE
ALTER AUTHORIZATION ON DATABASE::[database_name] TO [SA];
</pre>
<p>Developer.com provides a good simple introduction to Service Broker<br />
<a href="http://www.developer.com/db/article.php/3640771">http://www.developer.com/db/article.php/3640771</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.yeticode.co.uk/2009/02/sql-service-broker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
