查看SQLServer中各表的数据量以及占用空间大小

CREATE TABLE #T (NAME nvarchar(100),ROWS char(20),reserved varchar(18) ,Data varchar(18) ,index_size varchar(18) ,Unused varchar(18) )
GO
INSERT #T EXEC SP_MSFOREACHTABLE "EXEC sp_spaceused "?""


SELECT * FROM #T ORDER BY CONVERT(INT,REPLACE(DATA,"KB","")) DESC

 

感谢:http://www.mybbchina.net/sql/356570.html

posted @ 2020-05-22 15:07  蜗牛的礼物  阅读(2985)  评论(0编辑  收藏  举报