Solved

Need to duplicate changes from Server A - Table A to Server B - Table B

Posted on 2011-09-20
4
191 Views
Last Modified: 2012-08-13
Hello Experts,

We have a web application which makes changes to a database table.  Lets call it Server A - Table A.  I would then like to, on the database end, mirror those changes to an identical table that lives on a different server.  Lets call it Server B - Table B.

So if a new row of data is added to Server A - Table A, I'd like Server B - Table B to be updated with the same changes.  Same if a row is updated in Server A - Table A.  A row will never be deleted so no need to worry about that.

What's the best way to do this?  Any help would be appreciated.

Thanks,
Moe
0
Comment
Question by:mauricerichard
4 Comments
 
LVL 5

Accepted Solution

by:
zvytas earned 500 total points
ID: 36567702
The best way to do something like this is using MS SQL replication. There are billions of pages about replication you can find in search engines.
Another option would be creating a trigger on Table A which updates Table B. If two databases are not on the same SQL Server, you'll need to create a linked server (again - search engines will point you to the right direction).
One caveat to have in mind with option 2 is performance, hence I would not recommend it.
0
 
LVL 2

Expert Comment

by:beridius
ID: 36567750
like zvtas said the best way is replication of tables if you are using mssql http://msdn.microsoft.com/en-us/library/ms151198.aspx  
if you are using mysql (phpmyadmin) then I would goto http://dev.mysql.com/doc/refman/5.0/en/replication.html
This method replicates the database everytime it is updated.
If you use this method make sure you use trigger so you can work out if the replication is running.

0
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 36573129
Replication or log shipping is the best way to do

Other way is SSIS package to move new or updated rows to destination server.
0
 
LVL 1

Author Closing Comment

by:mauricerichard
ID: 36903683
Replication seems to be the concensus ... thanks to everyone who participated!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now