How to programatically detemine if a database has a merge subscription.

  • Is there a good way that will work with both SQL 2005 and SQL 2000 to determine within a stored proc if a database is a subscriber in a merge replication?

    What we have done in SQL 2000 is check for the existence of the sysmergesubscriptions table with a row where the subid does not match the partnerid. In SQL 2005 the partnerid column has changed to pubid.

    Is there a cleaner way?

    I need a SP that will work on both.

    Thanks.

  • Actually PubID exists in both but PartnerID was removed in SQL 2005.

    I could probably use PubID for my purposes but still wonder if there is a cleaner way.

    Thanks.

  • You have a view on both pub & subscribers exposing merge article info:

    sysmergeextendedarticlesview

    and a table w/ 1 row for each merge pub defined in pub & subscr db's

    sysmergepublications

    ChrisB MCDBA

    MSSQLConsulting.com

    Chris Becker bcsdata.net

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply