Try this ... it's one of those "I wrote it for myself" things...
You have to adjust the "TOP" value for the number of subscribers you have.
-------------------------
use distribution
go
select Subscriber_DB,
'Run Status' =
CASE RunStatus
WHEN 1 THEN 'Start'
WHEN 2 THEN 'Succeed'
WHEN 3 THEN 'InProgress'
WHEN 4 THEN 'Idle'
WHEN 5 THEN 'Retry'
WHEN 6 THEN 'Fail'
WHEN 23 Then 'Ibison did it'
ELSE 'Unk?'
END,
Delivery_Latency as 'Latency ms',--Delivery_Latency / 60000.00 as
'Latency mins',
cast(Duration / 3600.00 as decimal(8,2)) as 'Dur(Hrs)',
cast(Delivered_Transactions as varchar(10)) + ' (' +
cast(Delivered_Commands as varchar(12)) + ')' as 'DelTrans (cmds)',
cast(Delivery_Rate as int) as 'Del Rate',Total_Delivered_Commands as
'TotalDelCmds',
[Time],Start_Time
from MSDistribution_History join MSDistribution_Agents on Agent_ID = [ID]
where [time] in (select top 3([time]) from MSDistribution_History order by
time desc) and
name in (select distinct name from MSDistribution_Agents )
order by SubscriberDB
-----------------------------------
[quoted text, click to view] "Hilary Cotter" <hilary.cotter@gmail.com> wrote in message
news:uLf%23A8$8EHA.1228@tk2msftngp13.phx.gbl...
> You shouldn't have to check the status as replication is essentially an
> asynchronous process.
>
> You could use sp_MSenum_replication_agents to tell you the status however.
>
> usage is sp_MSenum_replication_Agents @type=1
>
> where type=
> 1--snapshot
> 2--logreader
> 3--distribution
> 4--merge
> 5--misc
> 9--queue reader
>
> here is a list of what the values in the status column represent
> 1--starting
> 2 --stopped/completed
> 3--executing
> 4--competed/idle
> 5--retry
> 6-- failed
> -23 --Paul Ibison has been messing with your server
>
>
>
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
>
http://www.nwsu.com/0974973602.html > "Sharad" <Niitmalad@yahoo.co.in> wrote in message
> news:171401c4f3f1$284b7c00$a501280a@phx.gbl...
> > Dear Friends
> >
> > Please suggest where i can get the status for the
> > replication ( Same is working or in failed status ). What
> > i want to do is when the user is taking the INVOICENUMBER
> > from the application it should check for the status of
> > the replication if the same is working or not.
> >
> > Your guidance will enable me to solve the problem.
> >
> > Thanks and best regards
> > Sharad
>
>