Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 17th, 2004, 08:52 AM
Authorized User
 
Join Date: Aug 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Removing Subscription information at a Subscriber

I'm trying to implement Merge Subscriptions between two servers. The question is, how can I programmatically remove the subscription information from the subscriber?

I can call sp_dropmergesubscription at the Publisher but this does not affect the Subscriber server. Deleting rows from the sysmergesubscriptions, sysmergearticles, and sysmergepublications tables will remove the subscription item in the server's Replication folder.

There is a dependency between each replicated table and a set of system sprocs/triggers, all of which I can remove programmatically. I've can also drop rows from MSmerge_replinfo and MSmerge_genhistory.

However, even after doing this I am unable to drop the table despite there being no apparent dependencies.

Can anyone help? I would have thought this would be a fairly common task - surely at least as common as removing a subcription on the publisher side, which warrants its own system sproc.

Thanks

 
Old August 20th, 2004, 10:03 AM
Authorized User
 
Join Date: Jul 2004
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I havn't had much success at that either. the only way I was able to do it was to disable replication and then re-enable it which is fine if thats the only database your replicating. If you hear of another way let me know!
David
 
Old August 23rd, 2004, 02:45 AM
Authorized User
 
Join Date: Aug 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've cracked it!

There is a stored procedure sp_mergesubscription_cleanup which should be run against the subscription database at the Subscriber. This does what it says on the tin, allowing the replicated articles to be dropped at the subscriber without complaint.

And why did it take so long for me to find this out? Well apart from the Books Online not actually referring to this sproc when dealing with sp_dropmergesubscription and the Publisher side of things, when I finally found that sp_mergesubscription_cleanup even existed the help files specify that it should be run at the Publisher!!!

Note that there is another sproc called sp_subscription_cleanup which I guess is the equivalent for snapshot and transactional replication. Books Online gets it correct for this one, specifying it should be run at the Subscriber.






Similar Threads
Thread Thread Starter Forum Replies Last Post
subscription type in newsletter vantoko BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 6 September 24th, 2007 01:15 PM
process could not make a genat the Subscriber SenthilKannan SQL Server 2000 0 June 21st, 2006 09:55 PM
Subscription issue srinivasae BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 March 23rd, 2006 10:21 AM
Bug in Subscription Section? Imar Forum and Wrox.com Feedback 0 October 2nd, 2003 03:44 PM
Where is my subscription mail? richard.york Forum and Wrox.com Feedback 3 September 8th, 2003 02:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.