-- Dynamic table variable in a query declare @v varchar(30) set @v='pjproj' exec ('select * from ' + @v)