SQL Server表的数据量大小查询

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


SELECT * FROM #Temp ORDER BY CONVERT(INT,REPLACE(DATA,'KB','')) DESC

DROP TABLE #Temp

 

posted @ 2023-01-19 10:00  Aaronguo  阅读(194)  评论(0编辑  收藏  举报