CREATE TABLE #_A_TableSpaceUsed(
TableName SYSNAME,
Rows INT,
Reserved VARCHAR(20),
DataSize VARCHAR(20),
IndexSize VARCHAR(20),
UnUsed VARCHAR(20))
EXEC sp_MSForEachTable
@command1=N'insert into #_A_TableSpaceUsed exec sp_spaceused ''?'''
SELECT * FROM #_A_TableSpaceUsed ORDER BY Rows DESC
DROP TABLE #_A_TableSpaceUsed
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16754036/viewspace-709687/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/16754036/viewspace-709687/