• Also, you can't use a variable in a select statement for a tablename, unless the variable itself is a table variable (confused?).

    What you are trying to do would require the use a dynamic sql. Read BOL for more info, then ask more questions for clarity.

    😎