I would like to know if it is possible, and how it is done, to update data from one table by others from another.
For example:
Table 1:
id_tabla1 | Nombre | Descripcion
Table 2:
id_tabla2 | Nombre | Descripcion
The difference between table 1 and 2, is that the 1 has the first 2 records that can not be touched, that is, they should always be fixed, yes or yes.
Table 2 is updated every day (Data is added and modified) What I need is to insert all the data from table 2 in the 1. Either by inserting the new ones and updating the old ones, or by deleting all the data from table 1 minus the first 2 records and then inserting those from table 2.
Can it be done?
Table 1 is in MYSQL and 2 in SQL Server. I have them related, that is, from the sql server I do the queries of the mysql tables. An example would be:
id_tabla1 | Nombre | Descripcion
1 a a1
2 b b1
3 c c1
Table 2:
id_tabla2 | Nombre | Descripcion
1 a a1
2 b b1
3 c c2
4 d d1
Then what I need is to insert in table 1 the line of id 4 of table 2 and update the line of id 3.