一方静土

导航

 

CREATE TABLE #tmptb(tbname sysname,tbrows int
,tbREserved varchar(10),tbData varchar(10)
,tbIndexSize varchar(10),tbUnUsed varchar(10))
INSERT INTO #tmptb exec sp_MSForEachTable 'EXEC sp_spaceused ''?'''
SELECT * from #tmptb --列出所有表的情况
SELECT tbrows ,tbname FROM #tmptb WHERE tbrows=0 --列出记录数据为0的表
ORDER BY tbname
DROP TABLE #tmptb

posted on 2016-07-04 15:02  Daniel Rudy  阅读(185)  评论(0编辑  收藏  举报