'Access data from tables as per environment in SSIS

I have 3 individual tables created to run in dev, Test and prod. For example - Table_Dev for Development, Table_Test for Test and Table_Prod for Production. If the package is executing in dev, the data should be accessed from Table_Dev, for Test it should be from Table_Test and so on

Also, I have a logging table created in SQL Server. For example, the table structure is

   Create Table Logging_Table(
     Environment [nvarchar](50) NOT NULL,
     DbName [nvarchar](50) NOT NULL,
     TableName [nvarchar](50) NOT NULL
 )

The data from these tables should be inserted into the logging table in SQL Server as

INSERT INTO Logging_Table (Environment , DbName , TableName)
VALUES (Dev/Test/Prod, DatabaseName, TableName);

I want to use an SSIS Package. But I am not sure which table to use as source because I need single package to be deployed into all the 3 environments by using the 3 tables.

In the Data flow task, I am unsure about the source to be used. Should it be Table_Dev/Table_Test/Table_Prod. How can I deploy them to the respective environments?

How can I do it using SSIS?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source