Replication

Config Server as Publisher and Distributor

  1. Launch SQL SERVER ENTREPRISE MANAGER
  2. Tools > Replication > Configure Publishing, Subriscribers, and Distribution
  3. Tab Publishers : Check the server in the Publishers column, then Ok in the warning dialog, then Ok in the Publisher Properties dialog, then OK in the Publisher and Distributor Properties dialog

Publish MS5

  1. Node Replication > Publications : Right-click > New Publication
  2. In the wizard, Next, then choose VanSalesSystem database, then Next, select Merge Replication, then Next, then Next
  3. Select to publish the following articles : (T_ISSUEORDER, T_ISSUEORDERITEM, T_USER, T_PRODUCT, T_SECTOR, V_CONTRACTOR, V_ISSUEORDER, V_ISSUEORDERITEM, V_PRODUCT, V_SECTOR, T_CUSTOMER, V_CUSTOMER), then Next
  4. Then Next, then Next, then Next, then Finish, then Close

Publish MS3

  1. Node Replication > Publications : Right-click > New Publication
  2. In the wizard, Next, then choose inventory database, then Next, select Merge Replication, then Next, then Next
  3. Select to publish the following articles : (T_ISSUEAUTH, T_ISSUEAUTHITEM, T_STOCK, T_MIDDLEWARE), then Next
  4. Then Next, then Next, then Next, then Finish, then Close

Config MS3 Publication Special Case

  1. Node Replication > Publications > inventory:inventory : Right-click > Proprieties > tab Articles
  2. Select T_ISSUEAUTH and click on Proprieties, then tab Snapshot
  3. Check "Delete all data in existing table", then Ok, then Ok
  4. Select T_STOCK and click on Proprieties, then tab Snapshot
  5. Check "Delete all data in existing table", then Ok, then Ok

Config Server as Subscriber

  1. Tools > Replication > Configure Publishing, Subriscribers, and Distribution
  2. Tab Subscribers : Check the server in the Subscribers column, then Ok

Subscribe MS5 to MS3

  1. Node Replication > Publications > inventory:inventory : Right-click > Push New Subscription, then Next, then select the subscriber, then Next
  2. In Subscription database name, enter VanSalesSystem then Next, check Continiously, then Next, check "Start the Snapshot Agent to begin the inititialization process immediately", then Next
  3. Next, then Next, then Finish, then Close

Subscribe MS3 to MS5

  1. Node Replication > Publications > VanSalesSystem:VanSalesSystem : Right-click > Push New Subscription, then Next, then select the subscriber, then Next
  2. In Subscription database name, enter inventory then Next, check Continiously, then Next, then Next
  3. Next, then Next, then Finish, then Close

Config Trigger in MS5

  1. Node Databases > VanSalesSystem > Tables, Right-Click T_ISSUEAUTH, then All Tasks > Manage Triggers
  2. Replace [TRIGGER NAME] by [TRIGGER MS3MS5]
  3. After AS, new line and type : EXEC sp_makewebtask 'C:\Mughamrat\replcache.txt', 'SELECT TOP 1 ISSUEAUTH_ID FROM T_ISSUEAUTH'
  4. Click Ok

To Remove Replication

  1. Tools > Replication > Disable Publishing and Distribution
  2. In case of orphans subscriptions, they can be remove as follows on Query Analyzer :
  • sp_removedbreplication @dbname='Inventory'
  • sp_removedbreplication @dbname='vanSalesSystem'
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License