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
标签:varchar,Temp,EXEC,18,Server,数据量,SQL,TABLE From: https://www.cnblogs.com/aaronguo/p/17061094.html