This blog shows how to query data in the temporary table and the table variable tables:

Example:

Select * from #empsalary (Temporary Table)

Select * from @empsalary (Table Variable)