all groups > sql server replication > march 2004 >
You're in the

sql server replication

group:

Problem in replication


Problem in replication sharad
3/14/2004 9:37:44 AM
sql server replication:
Dear Friends

I am working on Merge Push replication and the same is
based on VPN connection. when the VPN connection is down
the replication do not find the subscriber and the same
is failed now when the VPN is connected i have to
activate the replication manually i want that the
replication should try every 15 min for 36 hours. One of
SQL Guru have given me the following code to create the
procudeure which will send me a mail after 4 hours that
the replication is down. but it is giving an error as
follows:

"Server: Msg 170, Level 15, State 1, Procedure
spuLogMergeFailures, Line 9
Line 9: Incorrect syntax near 'xp_sendmail'."
***************************************
create procedure spuLogMergeFailures
as
begin
declare @count tinyint
set @count = (select iCountLog from
tLogMergeFailures)
if @count = 3
begin
update tLogMergeFailures set iCountLog =
4,
xp_sendmail @recipients
= 'shailesh@geminicorp.be',
@message = 'Replication Failed for BPO',
@subject = 'Replication Failed'
return
end
update tLogMergeFailures set iCountLog =
iCountLog + 1
end
go

****************

Please suggest.

Best regards
Re: Problem in replication Hilary Cotter
3/14/2004 2:08:29 PM
set your merge agent to run in continuous mode. Then schedule it to run
every 5 minutes.

This way when it fails it will restart in 5 minutes.

Or you can have your merge job loop on itself, so at the end of step 3 it
will return to step 1 on success and failure.

[quoted text, click to view]

RE: Problem in replication Paul Ibison
3/15/2004 1:06:07 AM
Sharad
I vaguely remember this question from a while back and recognise the script - mine :-) . This is for a delayed logging scenario (to send an email after x consecutive failures), but I must apologise for an oversight - to run xp_sendmail you must use the full path - exec master.dbo.xp_sendmail. You'll need to combine this with Hilary's answer which will ensure that the merge agent keeps restarting. This script is run on failure and as far as I recall there was another script to reset the counter which is run on success but this one shouldn't need editing
Regards
AddThis Social Bookmark Button