We were supplied an ETL package to run that updates tables from another server into our local db however when we run the package, there is a process that creates a new table for each table that gets updated that stores the dataset of the table before it was updated. We were told not to modify the existing package in any way but that we can add another task at the end to remove these tables.
Example;
Updating tbl name [dbo].[exampletbl]
Then creates 2 tables in the db
[dbo].[exampletbl]
[dbo].[exampletbl_old]
What we want to do is remove all the tables from that db that have been given the suffix _Old in a Execute SQL statement after the updating process has been completed.
How can this be achieved? I assume there is a way to completely remove all tables from a db where the name is like _Old.