//查询数据库各表占用空间的情况

drop table #t
create table #t(name varchar(255), rows bigint, reserved varchar(20), data varchar(20), index_size varchar(20), unused varchar(20))
exec sp_MSforeachtable "insert into #t exec sp_spaceused '?'" 
select * from #t

 

 

 

//查询数据库各表的列表

select * from information_schema.tables

posted on 2015-09-28 14:01  qqhfeng16  阅读(446)  评论(0编辑  收藏  举报