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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

博客园 - silverlightfans

扩招的后果(搞笑版) 数据仓库构建实施方法及步骤(转载) treeview非xml数据源绑定 VS 2008 JavaScript Intellisense for Silverlight google 的百毒视频,巨搞笑啊,不知道是不是真的 国际支付平台又添新成员Amazon FPS asp.net 客户端回调功能的实现机制探讨(响应部分及可能的优化) asp.net 客户端回调功能的实现机制探讨(请求部分) 黎巴嫩的一位mvp写的一篇文章 关于为什么web service 构造函数只能是无参数构造函数问题的解答 Silverlight:动态从服务器端获取XAML来绘制前台 javascript附加事件,ff 和 ie 网易的高级提示功能 asp.net ajax 包装得似乎有些过分 PageMethods未定义 的解决 微软为google修改Vista 最好不要使用百分比宽高来创建silverlight Silverlight:一个IE浏览器 利用Tiny Framework 从托管代码中直接操作页面的 DOM元素
sql server 获取数据库中每个表的磁盘占用情况
silverlightfans · 2007-09-27 · via 博客园 - silverlightfans

create table tmp (name varchar(500),rows int,reserved varchar(500),
  data 
varchar(500),index_size varchar(500),unused varchar(500))
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 [rows] desc 
drop table tmp

或者使用我自己写的,不过只有行数,没有使用系统存储过程

 1declare @maxrowcount int
 2declare @maxtablename varchar(200)
 3declare @sql nvarchar(2000)
 4declare @tempcount int
 5set @sql = '';
 6set @maxtablename = '';
 7create table #rowcount
 8(counts int,tname varchar(200))
 9declare Tnamecursor cursor for select name from sysobjects where xtype = 'U' and OBJECTPROPERTY(id, N'IsUserTable'= 1
10declare @name varchar(200);
11open Tnamecursor
12FETCH NEXT FROM Tnamecursor INTO @name
13WHILE @@FETCH_STATUS = 0
14    BEGIN
15        set @sql = 'select @tempcount = count(*) from '+@name +'  insert into #rowcount values (@tempcount,@name)';
16print @sql            
17exec sp_executesql @sql,N'@tempcount int,@name varchar(200)',@tempcount,@name
18            --print @name+'total count:'+Convert(varchar(200),@tempcount)
19            if(@maxrowcount <@tempcount)
20                begin
21                set @maxrowcount = @tempcount;
22                set @maxtablename = @name;
23                end
24        FETCH NEXT FROM Tnamecursor INTO @name
25    end
26CLOSE Tnamecursor
27DEALLOCATE Tnamecursor
28
29select * from #rowcount order by counts desc
30
31drop table #rowcount
32
33
34
35
36
37

posted on 2007-09-27 18:50  silverlightfans  阅读(485)  评论()    收藏  举报