获取临时表列信息

select SO.name 表名,SC.name 表列名,SC.colid 索引,SC.length '大小',ST.name 类型
from tempdb..sysobjects SO,tempdb..syscolumns SC,tempdb..systypes ST
where SO.id=SC.id and SO.xtype='U' and SO.status>=0 and Sc.xtype=ST.xusertype and SO.name='##sssff'
order by SC.colorder

 

--非临时表去掉tempdb..

posted @ 2012-08-23 00:22  事理  阅读(248)  评论(0编辑  收藏  举报