B
B
beduin012014-07-12 11:37:10
Database
beduin01, 2014-07-12 11:37:10

How to synchronize two tables correctly?

Use Python, but the language is not the point here.
There are two identical tables in structure:

+-----+-------+------------+
|ID   |Name   |  Company   |
+--------------------------+
|1    | Dmitry|RKS         |
|2    | Petr  |HTD         |
|3    | Misha |CHPU        |
+-----+-------+------------+

A new entry can be added to each of them by hand. How will the algorithm for checking and transferring a new record from one table to another look like. I was told that I need to add another ID and somehow use it, but I did not quite understand

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fadmin, 2014-07-19
@Fadmin

You would specify a DB, it would be easier.
If the tables are in the same database, then it is probably worth revising the application architecture.
In mssql you can use merge.
technet.microsoft.com/en-us/library/bb510625%28v=s...
percona has pt-table-sync
www.percona.com/doc/percona-toolkit/2.1/pt-table-s...
Well, either by hand:
1. through triggers.
2. Add another ID - it must refer to another table.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question