Tuesday, October 12, 2010

Check Merge Replication Confilicts 2005

CREATE PROCEDURE [dbo].[DBA_MonitorMergeConflicts]
AS
/****************************************************
Purpose : Check Merge Replication Confilicts and send
an email notification to DBA
*****************************************************/
SET NOCOUNT ON
Declare @iCnt int
Select @iCnt = count(*) from NorthWind.dbo.MSmerge_conflicts_info
--Print @iCnt


If @iCnt > 0
Begin
 EXEC msdb.dbo.sp_notify_operator
 @profile_name = N'DBAMail',
 @name = N'dba',
 @subject = N'Merge Conflicts Notification',
 @body = N'There are Merge Replication Conflicts Please check the  View Conflicts to Resolve' ;
End