How to retrieve field names from temporary table (SQL Server 2008)

前端 未结 7 1829
借酒劲吻你
借酒劲吻你 2020-12-01 01:01

I\'m using SQL Server 2008. Say I create a temporary table like this one:

create table #MyTempTable (col1 int,col2 varchar(10))

How can I r

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 01:47

    select * from tempdb.sys.columns where object_id =
    object_id('tempdb..#mytemptable');
    

提交回复
热议问题