I am trying to access a table through its name, which is of varchar data type. The name of the table is stored in a field on another table and I want to be able to get that. For example, say the table name is stored in varchar variable @tablename;
SELECT * FROM @tablename
general syntax isn't working - is there any way to do this?