标签: sql-server sql-server-2008
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
显示除临时表之外的所有表的列。如何获取临时表列,然后按表名聚合并计算它们?
答案 0 :(得分:4)
CREATE TABLE #T ( X INT, Y INT ) SELECT * FROM tempdb.sys.columns WHERE object_id = object_id('tempdb..#T')