Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Detecting Replication Subscription snapshot success

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-08-31 : 10:29:19
Normajean writes "Hi;
I have been researching this topic for literally weeks and cannot find a way to programmatically detect when data is available in a subscription.
I WISH I could capture results from the sp_helpSubscription, because the results I want are in the results of this system stored procedure. But I get an error regarding a 'nested EXEC INTO' when I try to execute this sproc and save results into a local table.
I create publications programmatically, then subscribe programmatically - no problem whatsoever doing this, BUT I then need to seed the tables with test data. Foreign key constraints mean that the snapshot data needs to be finished and available. I want to write a loop that waits until the snapshot is finished being applied and data is available before I move onto the next seed data step, but cannot find a way to detect the data availability in the subscription.
I know that sp_helpSubscription has the item I need, but cannot get to it in the middle of a procedure because it doesn't allow me to save results to a table. I have looked into using syssubscriptions table, it looked promising, but doesn't seem to work either. I have spent at least 100 hours trying to crack this, and don't know WHY it is SO hard to find a way to monitor programmatically the status of my subscription on the fly. Please help if you can, I am desparately in need of getting my project up and running. Thank you soooo much in advance."

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-08-31 : 21:43:51
I usually take sample rows from publisher and check if they are already in the subscriber, on one scenario, i only take the row count

or you can check the job history for the agent in the publisher

or you can take that sp you were talking about and modify it, not just call it from another sp to resolve the nested problem


hope that helps...

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -