欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

SQLServer如何查看数据库中表占用的磁盘空间

程序员文章站 2024-02-22 21:56:12
...
CREATE TABLE tb_SpaceInfoTable
(
ID int identity(1,1),
name sysname,
rows char(11),
reserved varchar(18),
data varchar(18),
index_size varchar(18),
unused varchar(18)
)
GO

EXEC SP_MSFOREACHTABLE
@COMMAND1 = 'INSERT INTO tb_SpaceInfoTable(name,
rows,
reserved,
data,
index_size,
unused)
EXEC SP_SPACEUSED ''?'''
GO

SELECT * FROM tb_SpaceInfoTable
GO
相关标签: Go SQL