1 - Publisher, Many - Subscribers

  • Hello Guys,

    I hv done an windows application in which i can set merge replication that we do through SQL 2005 management studio.

    This application is done completely using SQL 2005 system stored procedures.

    in my application i m able to setup the relationship between 1 publisher and 1 subscriber.

    Now i want to setup the same for 1 Publisher and Many subscriber, so for doing this is if anyone has any system stored procedure from please let me know.

    Thanks,

    Sagar.

  • Use the following - you can get this syntax by scripting out your own publication:

    exec sp_addmergesubscription @publication = N'MergePubName', @subscriber = N'SubscrSvrName1', @subscriber_db = N'dbName', @subscription_type = N'Push'

    , @sync_type = N'Automatic', @subscriber_type = N'Global', @subscription_priority = 75, @description = N'', @use_interactive_resolver = N'False'

    exec sp_addmergepushsubscription_agent @publication = N'MergePubName', @subscriber = N'SubscrSvrName1', @subscriber_db = N'dbName', @job_login = null

    , @job_password = null, @subscriber_security_mode = 1, @publisher_security_mode = 1, @frequency_type = 4, @frequency_interval = 1, @frequency_relative_interval = 1

    , @frequency_recurrence_factor = 0, @frequency_subday = 8, @frequency_subday_interval = 1, @active_start_time_of_day = 0, @active_end_time_of_day = 235959

    , @active_start_date = 0, @active_end_date = 0

    GO

    exec sp_addmergesubscription @publication = N'MergePubName', @subscriber = N'SubscrSvrName2', @subscriber_db = N'dbName', @subscription_type = N'Push'

    , @sync_type = N'Automatic', @subscriber_type = N'Global', @subscription_priority = 75, @description = N'', @use_interactive_resolver = N'False'

    exec sp_addmergepushsubscription_agent @publication = N'MergePubName', @subscriber = N'SubscrSvrName2', @subscriber_db = N'dbName', @job_login = null

    , @job_password = null, @subscriber_security_mode = 1, @publisher_security_mode = 1, @frequency_type = 4, @frequency_interval = 1, @frequency_relative_interval = 1

    , @frequency_recurrence_factor = 0, @frequency_subday = 8, @frequency_subday_interval = 1, @active_start_time_of_day = 0, @active_end_time_of_day = 235959

    , @active_start_date = 0, @active_end_date = 0

    GO

    etc...

    Then run snapshot of course...

    ChrisB MCDBA

    MSSQLConsulting.com

    Chris Becker bcsdata.net

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

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