exec (@sql)
fetch next from Cursor1 into @TableName
end
close Cursor1
deallocate Cursor1
go
--顯示結果
select * from TableSpace
--order by TableName
--order by TableName ASC --按表名稱,用于統計表
--order by RowsCount DESC --按行數量,用于查看表行數
--order by Reserved DESC, Data DESC --按占用空間
--order by Index_size DESC, Reserved DESC --按索引空間查看
go
--查看庫的使用狀況,可以隨時執行的。
--exec sp_spaceused
--go
文章來源于領測軟件測試網 http://www.kjueaiud.com/