I am using SQL Server Management Studio 17.0. I have a table that manages separate tables for different files, for example:
filename | tablename
---------+----------
file1 | table1
file2 | table2
I need select from tablename, but not hardcoded. The file name comes from the Internet, and I can fist get the name of the tab, for example
select tablename
from filetables
where filename = "file1"
and use it to view the file table:
select *
from (table1)
Is there any way to do this in SQL? Sort of
Select *
from
(select tablename
from filetables
where filename = "file1")
Salek source
share