Groups | Blog | Home
all groups > sql server replication > may 2007 >

sql server replication : how to detect transactional replication agent failure programmatic



FJY
5/18/2007 3:58:01 PM
Hello,

Right now, I have an alert set up in the SQL Server but is it possible for a
C#/C/C++/VB program to detect the replication agent failure? If so, how can
it be done?

Thanks in advance,

Paul Ibison
5/19/2007 12:00:00 AM
Something like this should do:
http://www.replicationanswers.com/Downloads/KillRunningJobs.txt
(1 = Executing, 2= Waiting For Thread, 3 = Between Retries, 4 = Idle, 5 =
Suspended, 6 =[obsolete], 7 = PerformingCompletionActions)
HTH,
Paul Ibison

Hilary Cotter
5/25/2007 7:42:14 AM
query the repl_errors table in the distirbution database.

select name, Publisher=p.srvname, publisher_db, publication,
Subscriber=s.srvname, subscriber_db, MSdistribution_history.time, comments,
error_type_id,source_type_id, source_name, error_code,error_text from
MSdistribution_history
join msrepl_errors on MSdistribution_history.error_id=msrepl_errors.id
join msdistribution_agents on
msdistribution_agents.id=MSdistribution_history.agent_id
join master.dbo.sysservers as p on p.srvid=publisher_id
join master.dbo.sysservers as s on s.srvid=publisher_id
order by 1



--
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
[quoted text, click to view]

AddThis Social Bookmark Button