Using SQL Server
I have queries that use table name
Select *
from MyDB..Table1 A inner join MyDB..Table1 B ON A.ID = B.ParentID
SELECT * FROM MyDB..Table1 WHERE No > @X
.
.
.
and I have to run these queries for 10+ tables
I don’t want to discuss the architecture of the database
but this is the status quo
I want a way to make table name variable (if possible) and change it in one place instead of all places
@declare @T as Table = MyDB..Table1
Select *
from @T A inner join @T B ON A.ID = B.ParentID
SELECT * FROM @T WHERE No > @X
.
.
.