Home Forums SQL Server 2005 SS2K5 Replication Need to replicate multiple databases (publications) to one central subscriber RE: Need to replicate multiple databases (publications) to one central subscriber

  • No worries. You are almost there. I don't know if you are SQL2000 or 2005 - so I will include both scripts to create a no-sync subscription (see below). Kill any existing subscription from DB2 to central subscriber.

    If you have PK values that are the same you can do 1 of the following:

    1) drop PK contraints at subscriber

    2) change distribution profile to 'Continue on data consistency errors'

    - this will ignore PK violation errors and skip, meaning command will not replicate.

    However, this may not be a problem if you let snapshot agent initialize from db1 - it probably didn't create pk's and other contraints...

    -- SQL2000 syntax

    exec sp_addsubscription @publication = 'PUBNAMEHERE'

    , @article = 'all'

    , @subscriber = 'SUBSCRSERVERNAME'

    , @destination_db = 'DBNAME'

    , @sync_type = 'none' -- no snapshot necessary

    GO

    -- SQL2005 syntax

    exec sp_addsubscription @publication = 'PUBNAMEHERE'

    , @article = 'all'

    , @subscriber = 'SUBSCRSERVERNAME'

    , @destination_db = 'DBNAME'

    , @sync_type = 'none' -- no snapshot necessary

    , @reserved='internal'

    GO

    Fire up your distribution agent (if it is not already) - and enjoy...

    ChrisB MCDBA

    MSSQLConsulting.com

    Chris Becker bcsdata.net