头一低,很多年都这样过去了...

欢迎来到Kittow的部落格! - http://blog.skyhe.com

Agile Web Development (敏捷Web开发)

Want to Know Something More? Move Your Mouse Here;)

我是天空的一片云,偶尔投影在你的波心,你记得也好,最好你忘掉,你我在交汇时,互放的光亮。
——徐志摩《偶然》 More...

我的VOA听写积分

2007-8-23 [返回]
[精华]获得所有表信息的SQL语句
这组SQL语句可以得到如下图的结果,超赞!


exec sp_MSForEachTable 
@precommand=N'
create table ##(
id int identity,
表名 sysname,
字段数 int,
记录数 int,
保留空间 Nvarchar(10),
使用空间 varchar(10),
索引使用空间 varchar(10),
未用空间 varchar(10))',
@command1=N'insert ##(表名,记录数,保留空间,使用空间,索引使用空间,未用空间) exec sp_spaceused ''?''
    update ## set 字段数=(select count(*) from syscolumns where id=object_id(''?'')) where id=scope_identity()',
@postcommand=N'select * from ## order by id drop table ##'

原址:http://www.xland.cn/article/74/36/0603/9142.htm
SQL Server未公开的两个存储过程:
http://fineboy.cnblogs.com/archive/2005/09/10/233910.html
转自:天河网 | www.skyhe.com

Posted at 11:13 PM | Comments[0]

转自:天河网 | www.skyhe.com

发表评论
We Used Ajax to Post Your Comment!
本站评论系统采用Ajax技术,无刷新发送评论
您的大名 *   
电子邮件  
5+6=? *(请输入“5+6=?”的结果)
评论内容 *