I have a table dbo.TableNames
with a varchar
column TableName
containing table names:
| Id | TableName |
+-----------+-----------------------+
| 1 | dbo.BookDictionary |
| 2 | dbo.AnotherDictionary |
What I am curious about, is there a way to instead of writing:
SELECT *
FROM dbo.BookDictionary
write something like:
SELECT *
FROM
(SELECT TableName FROM dbo.TableNames WHERE Id = 1)