
Signature
Hilary Cotter
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
> Thanks for your response.
>
[quoted text clipped - 103 lines]
>> >> > > Thanks,
>> >> > > Lavanya
Thanks Hilary for your help.
For the snapshot successful delivery confirmation, i check the status
of 'No replicated Transaction available' comment in
MSdistribution_history table from my C# application. This is more
reliable as am not sure of the number that succeeds the table name nor
am sure of the table which is the last to be delivered. This works
fine.
Now, i have another clarification.
>From my C#.Net application, i need to check whether there are any
pending transactions from publ. to subs. before i allow the user to
remove replication setup from the UI.
As previously asked,
1. Can i use sp_repltrans at publisher database, check if no rows are
returned and confirm that no data is pending to be transferred ?
2. Can i use sp_browsereplcmds at distribution database,check if no
rows are returned and hence confirm that subscriber and publisher are
in total sync ?
Reply asap.
Thanks in advance,
-Lavanya
> try looking for > Applied script 'Table4_4.dri' if that is the last thing to
> be delivered in your snapshot.
[quoted text clipped - 115 lines]
> >> >> > > Thanks,
> >> >> > > Lavanya
Hilary Cotter - 27 Dec 2006 16:30 GMT
No, to both. You have to hack msdistribution_status for the info you are
looking for.
Query MSsubscriptions to get the values you need for your subscriber
SELECT t.article_id,s.agent_id,
'UndelivCmdsInDistDB'=SUM(CASE WHEN xact_seqno > h.maxseq THEN 1 ELSE 0
END),
'DelivCmdsInDistDB'=SUM(CASE WHEN xact_seqno <= h.maxseq THEN 1 ELSE 0 END)
FROM (SELECT article_id,publisher_database_id, xact_seqno
FROM MSrepl_commands with (NOLOCK) ) as t
JOIN (SELECT agent_id,article_id,publisher_database_id FROM MSsubscriptions
with (NOLOCK) ) AS s
ON (t.article_id = s.article_id AND
t.publisher_database_id=s.publisher_database_id )
JOIN (SELECT agent_id,'maxseq'= isnull(max(xact_seqno),0x0) FROM
MSdistribution_history with (NOLOCK) GROUP BY agent_id) as h
ON (h.agent_id=s.agent_id)
where s.publisher_database_id=57 --obtained from mssubscriptions
and s.publisher_id=0 --obtained from mssubscriptions
and s.subscriber_id=7 --obtained from mssubscriptions
and s.subscriber_db='test' --obtained from mssubscriptions
GROUP BY t.article_id,s.agent_id

Signature
Hilary Cotter
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
> Thanks Hilary for your help.
>
[quoted text clipped - 147 lines]
>> >> >> > > Thanks,
>> >> >> > > Lavanya