SQL Server 查看表占用空间

 

代码
exec sp_MSForeachTable
@precommand=N' create table ##( table_name sysname, records int, save_space Nvarchar(10), use_space varchar(10), index_space varchar(10), free_space varchar(10))', @command1=N'insert ## exec sp_spaceused ''?''', @postcommand=N'select top 10 * from ## order by use_space desc drop table ##'

 

posted on 2010-07-14 09:34  trams  阅读(448)  评论(0编辑  收藏  举报