Is there any specific reason why you lean towards this approach?
I assume you would pass a different table name as value to the global variable.It is not possible. I would not suggest the idea of extracting the tables using SQL transform. By doing that you will be missing the impact/lineage analysis and potentially it will lead to poor performance as well.