Script to review replications


This script is from my library and I use it to review what is going on with my transactional replications, try to remove statements that didn't get purged for whatever reason. This is my last resource before getting the need to reinitialize or drop and recreate my publications.

use distribution

/*Query to get your articleID*/
select top 100 * from Distribution.dbo.MSarticles

/*Use this when you have the xac_seqno that is failing or your last that was replicated*/
select * from MSrepl_commands Where xact_seqno >= 0x0005AEF70000004A000900000000

/*use this to review your errors*/
From MSrepl_errors

/*use this to list the commands to be replicated*/
sp_browsereplcmds '0x0005AEF70000004A000900000000', '0x0005AEF70000004A000900000000'

/*Once that you have the commands to be deleted, add them inside the IN*/
DELETE from MSrepl_commands where command_id=1 and xact_seqno in (0x0005ADE2000001E00009)
and [command] like '%MSins%'

Original post (opens in new tab)