I have a table with names of other tables. How can I create a query that gets the table from the values?
For example, if my table has the values:
tables
------
users
users2
users3
I want to create Dynamic SQL function that knows how to take the values (i.e. the table names) from the reference table and then select * from that named value.