Transfer data from the cloud to a local database
This is returns column and table names you can use to build up the statements  

select column_name, table_name, ORDINAL_POSITION 
from information_schema.columns
order by table_name, ordinal_position


I would do it in this order: delete, update, insert
Merge is known to have some issues