<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: T-SQL Script: Return Replication info plus the number of undistributed commands for all subscriptions</title>
	<atom:link href="http://www.pythian.com/news/1514/t-sql-script-return-replication-info-plus-number-of-undistributed-commands-for-all-subscriptions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pythian.com/news/1514/t-sql-script-return-replication-info-plus-number-of-undistributed-commands-for-all-subscriptions/</link>
	<description>News and views from Pythian DBAs</description>
	<lastBuildDate>Fri, 10 Feb 2012 13:01:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: Raz</title>
		<link>http://www.pythian.com/news/1514/t-sql-script-return-replication-info-plus-number-of-undistributed-commands-for-all-subscriptions/#comment-680095</link>
		<dc:creator>Raz</dc:creator>
		<pubDate>Tue, 20 Dec 2011 17:51:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.pythian.com/blogs/?p=1514#comment-680095</guid>
		<description>I have implemented this script however I don&#039;t get any results. No rows return but when I run my script it gives me results.</description>
		<content:encoded><![CDATA[<p>I have implemented this script however I don&#8217;t get any results. No rows return but when I run my script it gives me results.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Akshay</title>
		<link>http://www.pythian.com/news/1514/t-sql-script-return-replication-info-plus-number-of-undistributed-commands-for-all-subscriptions/#comment-431131</link>
		<dc:creator>Akshay</dc:creator>
		<pubDate>Tue, 18 May 2010 09:58:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.pythian.com/blogs/?p=1514#comment-431131</guid>
		<description>Using the MSdistribution_status view in distribution db might be a better option. You can join it with msarticles,mspublications etc for more info.

select a.article,d.name,ds.* from 
MSdistribution_status ds inner join MSarticles a on ds.article_id=a.article_id
inner join MSdistribution_agents d on ds.agent_id=d.id</description>
		<content:encoded><![CDATA[<p>Using the MSdistribution_status view in distribution db might be a better option. You can join it with msarticles,mspublications etc for more info.</p>
<p>select a.article,d.name,ds.* from<br />
MSdistribution_status ds inner join MSarticles a on ds.article_id=a.article_id<br />
inner join MSdistribution_agents d on ds.agent_id=d.id</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohammed Mawla</title>
		<link>http://www.pythian.com/news/1514/t-sql-script-return-replication-info-plus-number-of-undistributed-commands-for-all-subscriptions/#comment-403297</link>
		<dc:creator>Mohammed Mawla</dc:creator>
		<pubDate>Sun, 07 Feb 2010 09:31:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.pythian.com/blogs/?p=1514#comment-403297</guid>
		<description>@commander:

&quot;sp_replmonitorsubscriptionpendingcmds&quot; applies only for Transactional replication and the equivalent for Merge is &quot;sp_showpendingchanges&quot;

I think I will write a new blog for that

@SQLBrook :

To return the actual pending commands , you will need to run &quot;sp_browsereplcmds&quot; which returns the replicated commands stored in the distribution database

http://msdn.microsoft.com/en-us/library/ms176109.aspx


I don&#039;t think it is a good idea to retrieve these commands or store them in a temp table because they can be thousands or millions and they will take so much time to retrieve ; better to retrieve them manually when there is a problem otherwise make sure DIST agent is running and delivering them</description>
		<content:encoded><![CDATA[<p>@commander:</p>
<p>&#8220;sp_replmonitorsubscriptionpendingcmds&#8221; applies only for Transactional replication and the equivalent for Merge is &#8220;sp_showpendingchanges&#8221;</p>
<p>I think I will write a new blog for that</p>
<p>@SQLBrook :</p>
<p>To return the actual pending commands , you will need to run &#8220;sp_browsereplcmds&#8221; which returns the replicated commands stored in the distribution database</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms176109.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms176109.aspx</a></p>
<p>I don&#8217;t think it is a good idea to retrieve these commands or store them in a temp table because they can be thousands or millions and they will take so much time to retrieve ; better to retrieve them manually when there is a problem otherwise make sure DIST agent is running and delivering them</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQLBrook</title>
		<link>http://www.pythian.com/news/1514/t-sql-script-return-replication-info-plus-number-of-undistributed-commands-for-all-subscriptions/#comment-403265</link>
		<dc:creator>SQLBrook</dc:creator>
		<pubDate>Sun, 07 Feb 2010 04:39:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.pythian.com/blogs/?p=1514#comment-403265</guid>
		<description>Hello,

Your query is great. I can get all the information. Is there anyway to get the actually pending command. Or can we update the quert to get the pending commands in another temp# table?

Thanks,
-B</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Your query is great. I can get all the information. Is there anyway to get the actually pending command. Or can we update the quert to get the pending commands in another temp# table?</p>
<p>Thanks,<br />
-B</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Commander</title>
		<link>http://www.pythian.com/news/1514/t-sql-script-return-replication-info-plus-number-of-undistributed-commands-for-all-subscriptions/#comment-402115</link>
		<dc:creator>Commander</dc:creator>
		<pubDate>Tue, 02 Feb 2010 14:40:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.pythian.com/blogs/?p=1514#comment-402115</guid>
		<description>Hi,
Your script is great for transactional replications
but what about merge replications
have any idea if or were can i find a similar script
many thanks!</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Your script is great for transactional replications<br />
but what about merge replications<br />
have any idea if or were can i find a similar script<br />
many thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohammed Mawla</title>
		<link>http://www.pythian.com/news/1514/t-sql-script-return-replication-info-plus-number-of-undistributed-commands-for-all-subscriptions/#comment-393693</link>
		<dc:creator>Mohammed Mawla</dc:creator>
		<pubDate>Sat, 19 Dec 2009 15:58:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.pythian.com/blogs/?p=1514#comment-393693</guid>
		<description>Hi jeff ,

The first subquery (sub1) will get list of all agents in the replication subsystem.

&quot;ALL&quot; refers to logreader agents but later in the code I&#039;m joining to another subquery (sub3) telling to retrieve only Distribution agents ( agent_type = 3 )

have you run the code as a whole block or you are running piece by piece ?

HTH</description>
		<content:encoded><![CDATA[<p>Hi jeff ,</p>
<p>The first subquery (sub1) will get list of all agents in the replication subsystem.</p>
<p>&#8220;ALL&#8221; refers to logreader agents but later in the code I&#8217;m joining to another subquery (sub3) telling to retrieve only Distribution agents ( agent_type = 3 )</p>
<p>have you run the code as a whole block or you are running piece by piece ?</p>
<p>HTH</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeff</title>
		<link>http://www.pythian.com/news/1514/t-sql-script-return-replication-info-plus-number-of-undistributed-commands-for-all-subscriptions/#comment-393379</link>
		<dc:creator>jeff</dc:creator>
		<pubDate>Fri, 18 Dec 2009 00:48:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.pythian.com/blogs/?p=1514#comment-393379</guid>
		<description>Hi there, i&#039;m just starting to dig into tsql for replication monitoring and found your script.

Its great, but i&#039;m having an issue.  

In the first subquery, the select from the msdistribution_agents table, in my case, with 17 records, all but 2 of them have &#039;all&#039; as the publication field.

This causes the join to fail.  I&#039;m still digging into what &#039;all&#039; means, but figured i&#039;d report it here as well.

thx for the hard work!</description>
		<content:encoded><![CDATA[<p>Hi there, i&#8217;m just starting to dig into tsql for replication monitoring and found your script.</p>
<p>Its great, but i&#8217;m having an issue.  </p>
<p>In the first subquery, the select from the msdistribution_agents table, in my case, with 17 records, all but 2 of them have &#8216;all&#8217; as the publication field.</p>
<p>This causes the join to fail.  I&#8217;m still digging into what &#8216;all&#8217; means, but figured i&#8217;d report it here as well.</p>
<p>thx for the hard work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohammed Mawla</title>
		<link>http://www.pythian.com/news/1514/t-sql-script-return-replication-info-plus-number-of-undistributed-commands-for-all-subscriptions/#comment-374805</link>
		<dc:creator>Mohammed Mawla</dc:creator>
		<pubDate>Mon, 14 Sep 2009 11:52:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.pythian.com/blogs/?p=1514#comment-374805</guid>
		<description>Thanks eyechart for the add</description>
		<content:encoded><![CDATA[<p>Thanks eyechart for the add</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eyechart</title>
		<link>http://www.pythian.com/news/1514/t-sql-script-return-replication-info-plus-number-of-undistributed-commands-for-all-subscriptions/#comment-368942</link>
		<dc:creator>eyechart</dc:creator>
		<pubDate>Fri, 07 Aug 2009 19:34:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.pythian.com/blogs/?p=1514#comment-368942</guid>
		<description>I made a change to your dynamic SQL so named instances would work.  

&#039;
SELECT &#039;&#039;&#039;+ @publisher +&#039;&#039;&#039; , &#039;&#039;&#039;+ @publisher_db +&#039;&#039;&#039; ,&#039;&#039;&#039;+ @publication + &#039;&#039;&#039; , &#039;&#039;&#039; + @subscriber + &#039;&#039;&#039; , &#039;&#039;&#039; + @subscriber_db + &#039;&#039;&#039; ,*
    FROM OPENROWSET (&#039;&#039;SQLOLEDB&#039;&#039;,&#039;&#039;Server=&#039;+@@servername+&#039;;TRUSTED_CONNECTION=YES;&#039;&#039;,&#039;&#039;set fmtonly off EXEC distribution..sp_replmonitorsubscriptionpENDingcmds @publisher= &#039;&#039;&#039;&#039;&#039;+ @publisher +&#039;&#039;&#039;&#039;&#039; ,@subscription_type=0, @publisher_db= &#039;&#039;&#039;&#039;&#039;+ @publisher_db +&#039;&#039;&#039;&#039;&#039;,@publication = &#039;&#039;&#039;&#039;&#039;+ @publication+&#039;&#039;&#039;&#039;&#039;,@subscriber= &#039;&#039;&#039;&#039;&#039;+@subscriber+&#039;&#039;&#039;&#039;&#039; ,@subscriber_db=&#039;&#039;&#039;&#039;&#039;+@subscriber_db+&#039;&#039;&#039;&#039;&#039;&#039;&#039;)
&#039;</description>
		<content:encoded><![CDATA[<p>I made a change to your dynamic SQL so named instances would work.  </p>
<p>&#8216;<br />
SELECT &#8221;&#8217;+ @publisher +&#8221;&#8217; , &#8221;&#8217;+ @publisher_db +&#8221;&#8217; ,&#8221;&#8217;+ @publication + &#8221;&#8217; , &#8221;&#8217; + @subscriber + &#8221;&#8217; , &#8221;&#8217; + @subscriber_db + &#8221;&#8217; ,*<br />
    FROM OPENROWSET (&#8221;SQLOLEDB&#8221;,&#8221;Server=&#8217;+@@servername+&#8217;;TRUSTED_CONNECTION=YES;&#8221;,&#8221;set fmtonly off EXEC distribution..sp_replmonitorsubscriptionpENDingcmds @publisher= &#8221;&#8221;&#8217;+ @publisher +&#8221;&#8221;&#8217; ,@subscription_type=0, @publisher_db= &#8221;&#8221;&#8217;+ @publisher_db +&#8221;&#8221;&#8217;,@publication = &#8221;&#8221;&#8217;+ @publication+&#8221;&#8221;&#8217;,@subscriber= &#8221;&#8221;&#8217;+@subscriber+&#8221;&#8221;&#8217; ,@subscriber_db=&#8221;&#8221;&#8217;+@subscriber_db+&#8221;&#8221;&#8221;&#8217;)<br />
&#8216;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

