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

 

posted @ 2022-03-20 11:05  芈璐  阅读(1644)  评论(0编辑  收藏  举报