I want to synchronize data from table 1 in server A to tables 2 and 3 in server B, whenever table 1 gets updated.
Tables from server A are not related to tables from server B, so I'd have to specify which columns in table 1 correspond to which columns in tables 2 and 3, and perhaps do some sort of operation on that data.
Server A, Table Y
Name | Country | Sales
Oscar | Peru | 5000
Server B, Table X
Name | Region | Amount | Currency | Multiplier | TotalAmount
Oscar | Peru | 5000 | € | 5 | 25000 (=5000*5)
The goal here is to insert the record from server A to the table X in server B.
- The 'Name' field maps to the 'Name' field
- The 'Country' field maps to the 'Region' field
- The 'Sales' field maps to the 'Amount' field
- The 'Currency' field in server B will always be €
- The 'Multiplier' field would be retrieved from another table in server B
- The 'TotalAmount' field would be the result of Amount * Multiplier
Would this be possible to automate? Is using triggers the way to go?
I'm using SQL Server (and SMSS). The sync doesn't need to be instantaneous, it could take up to 10 or 20 minutes. The two servers are already linked. Server B is not used just for read only queries.