Home  >  Article  >  Database  >  查询SQL Server表空间大小,便于了解占空间的是那些表

查询SQL Server表空间大小,便于了解占空间的是那些表

WBOY
WBOYOriginal
2016-06-07 14:55:031480browse

来自: http://blog.csdn.net/htl258/article/details/4029767 无 drop table ##goexec sp_MSForEachTable @precommand=N'create table ##(表名 sysname,记录数 int,保留空间 Nvarchar(10),使用空间 varchar(10),索引使用空间 varchar(10),未用空间 varchar(

来自: http://blog.csdn.net/htl258/article/details/4029767
drop table ##
go
exec sp_MSForEachTable 

@precommand=N'create table ##(
表名 sysname,
记录数 int,
保留空间 Nvarchar(10),
使用空间 varchar(10),
索引使用空间 varchar(10),
未用空间 varchar(10))',
@command1=N'insert ## exec sp_spaceused ''?''',
@postcommand=N'select * from ## order by 记录数 '
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn