Find how many rows replicated

How Do we find how many ROWS REPLICATED to subscriber at specific interval ?

August 20th, 2015 2:38pm

You can query the tables/views in Distribution database to get some of this information. However the level of detail would depend on your transaction and history retention settings on your distributor.

Check these out:

https://msdn.microsoft.com/en-us/library/ms187401.aspx

https://msdn.microsoft.com/en-us/library/ms179878.aspx

HTH

Free Windows Admin Tool Kit Click here and download it now
August 20th, 2015 9:15pm

Hi Vanchan,

The procedure below should get you started on being able to tell if a row has been sent to a subscriber, all you need to do is provide the rowguid and publication name.

use <PUB_DB_NAME>

go

create procedure ASubHasIt(@pubname sysname, @row uniqueidentifier)

as

declare @tablenick int

declare @maxsentgen int

select @maxsentgen = max(sentgen), @tablenick = max(nickname) from (sysmergesubscriptions sms joinsysmergepublications smp on sms.pubid = smp.pubid) join sysmergearticles sma onsma.pubid=smp.pubid where smp.name='PubName' and sms.sentgen IS NOT NULL

if exists (select * from MSmerge_genhistory gh join MSmerge_contents mc on mc.generation =gh.generation where gh.generation > @maxsentgen and mc.rowguid = @row)

begin

print 'Row ' + CONVERT(nvarchar(max), @row) + ' has NOT been sent to a subscriber'

end

else

begin

print 'Row ' + CONVERT(nvarchar(max), @row) + ' has been sent to a subscriber'

end

go

Example:

exec ASubHasIt @pubname='PubName', @row='8B348C04-B3A9-DB11-AEA6-000BDBD0506C'

August 20th, 2015 9:43pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics