Is there an easy way to compare two tables in different databases and return the difference ? I try to synchronize a SQL server table from IT with a MySQL table on the plant side. When the data changes in the IT table I need to update the table in the MySQL database. There is an existing connection in Ignition to both databases. I want to make sure that all items in the IT database exist in the MySQL table. Only two columns are important, an item and a description.
If you do something like the following:
SELECT IT-table.* FROM IT-table
LEFT JOIN MYSQL-table
WHERE ISNULL(MYSQL-table.id)you will end up with a dataset with records from IT-table which do not exist in MYSQL-table - you will obviously have to choose what fields to join the 2 tables on.
You can then loop through the dataset and add each row into MYSQL-table.