I need a SP to load many tables to a Stage db (source will be a linked server and you will read tables/views).
The names of the fields can be different in source and destiny. but the qnt of fields will be the same.
I will have a "table 1" with a list of the tables I need to load, fields will be:
-linked server name
-source table/view name
-destiny db name
-destiny db table name
I need a log table 2:
-id (of the table we are loading)
If there is a error, what can we do? please propose (mail, log, etc).
Your SP will read "table 1", first row, load data, then second and so on. With every "load", you will fill the log record.