How to retrieve field names from temporary table (SQL Server 2008)
select * from tempdb.sys.columns where object_id =
object_id('tempdb..#mytemptable');
select *
from tempdb.INFORMATION_SCHEMA.COLUMNS
where table_name like '#MyTempTable%'
select * from tempdb.sys.columns where object_id =
object_id('tempdb..#mytemptable');
select *
from tempdb.INFORMATION_SCHEMA.COLUMNS
where table_name like '#MyTempTable%'