Temporary Tables and Procedures

You can create a procedure to reference a temporary table if the temporary table is created in the current session. A temporary table created within a procedure is removed when the procedure exits.

System procedures such as sp_help work on temporary tables, but only if you use them from tempdb.

See the Transact-SQL Users Guide.