惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
D
Docker
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
月光博客
月光博客
小众软件
小众软件
量子位
V
Visual Studio Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
罗磊的独立博客
博客园 - 叶小钗
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
博客园 - 司徒正美
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
C
Check Point Blog

博客园 - 广思

IIS中加入piwik跟踪代码 注册表中启用对没有标记为安全的 ActiveX 控件进行初始化和脚本运行 安装Qvode后,在IE8的菜单工具中会出现《彩票》 将字符串写入图片 TRUNCATE 删除表内所有记录 Windows Server 2003 SP1本机访问报错-环回检查 通过Object传递参数 SQL Server 镜像部署 使用stsadm.exe工具实现SharePoint网站备份还原 不能打开文件:mk:@MSITStore:路径[cannot open the file mk@MSITstore:路径]解决办法 转 取得 SharePoint 中列表的Guid和列表视图的Guid (List's Guid and List View Guid) 安装Active Directory Tools For SharePoint 后无法添加到页面的原因 DirectoryEntry所有字段对应解释 windows picture and fax viewer 失效 验证配置设置时发生错误,已引发类型为System.Runtime.InteropServices.COMException的异常。其他异常信息:系统找不到指定的路径 Error message when you try to install a SQL Server 2005 service pack or a SQL Server 2005 hotfix package: "Error 29528. The setup has encountered an unexpected error while Setting Internal Properties" Excel With ADO.NET:Cannot modify the design of table ‘xxx′. It is in a read-only database 常用MSSQL语句:每个表大小,某个表所有列 Sql Server备份到远程服务器的另一种方法
查看 MSSQL 中数据表大小的方法
广思 · 2008-12-25 · via 博客园 - 广思

以前查看一个巨大的数据库,想把里面没用的东西删了,减少数据库文件的大小,但是不知道如何或者其中某个表的大小,后来经过一番努力终于找到如何查看SQL Server 2000 中数据表大小的方法了,在SQL Server 2005中,微软发布了一个报表,可以直接查看,但是这个报表不能用于SQL Server 2000。

写了下面这几条语句,可以返回每个数据表大小:

create table tmp (name varchar(50),rows int,reserved varchar(50),
data varchar(50),index_size varchar(50),unused varchar(50))
insert into tmp (name,rows,reserved,
data,index_size,unused) exec sp_msforeachTable @Command1="sp_spaceused '?'"--sp_spaceused 't_vehicle'
select * from tmp order by data desc
drop table tmp

--看单个表, 占用数据的情况
sp_spaceused 'retail11'

--查看整个数据库所有表占用空间的情况 但发现从sysindexes中取表, 会少一部分数据表(无主键,无索引的表)
select object_name(id) tablename,8*reserved/1024 reserved,rtrim(8*dpages/1024)+'Mb' used,8*(reserved-dpages)/1024 unused,8*dpages/1024-rows/1024*minlen/1024 free,
rows,* from sysindexes
where indid=1
order by reserved desc

--查看整个数据库所有表占用空间的情况 但看起来比较麻烦
exec sp_MSforeachtable "exec sp_spaceused '?'"

转自:http://www.cuobie.cn/skill/Show-SQL-Server-2000-data-tables-in-the-size/