这组SQL语句可以得到如下图的结果,超赞!

$uncut$
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.htmSQL Server未公开的两个存储过程:
http://fineboy.cnblogs.com/archive/2005/09/10/233910.html
Currently rated 1.3 by 3 people
- Currently 1.333333/5 Stars.
- 1
- 2
- 3
- 4
- 5