I am creating a temporary table on-the-fly using Select * Into #temp from SomeChangingSource
in a stored procedure. I need to then list the resulting columns.
Handling this for a regular (permanent) table is as simple as:
select COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS
where TABLE_NAME='TableName'
How do I handle this for a temporary table?