SELECT b.name AS tablename , a.rowcnt AS datacount FROM sysindexes a , sysobjects b WHERE a.id = b.id AND a.indid < 2 AND OBJECTPROPERTY(b.id, 'IsMSShipped') = 0 ORDER BY a.rowcnt DESC SELECT t.NAME AS TableName , s.Name AS SchemaName , p.rows AS Row…
查询所有数据库占用磁盘空间大小的SQL语句: ,),' MB') as data_size, concat(,),'MB') as index_size from information_schema.tables group by TABLE_SCHEMA order by data_length desc; 查询单个库中所有表磁盘占用大小的SQL语句: ,),' MB') as data_size, concat(,),' MB') as index_size from informatio…
原文地址:http://blog.csdn.net/pukuimin1226/article/details/7687538 ----查询数据库中用户创建的表 ----jsj01 为数据库名 select name tablename from jsj01..sysobjects where type='U' and name not in ('dtproperties') --查询表里的字段信息 exec sp_help 对象名 ---docs为表名 select * from syscolu…
每个mysql都有一个库information_schema,里面有一张表TABLES存储了所有数据库表的信息,因此,可以从这张表中查看数据库大小和表大小 查询数据库大小 ,),'GB') as data from information_schema.tables where table_schema='esb'; 查询数据库中表大小 ,),'GB') as data from information_schema.tables where table_schema='esb' and tab…
在Sqlserver数据库中,一般我们查看数据库的大小可以通过查找到数据库文件来查看,但如果要查找数据表Table的大小的话,则不可通过此方法,在Sqlserver数据库中,提供了相应的SQL语句来查询数据库DataBase的大小,以及库中相应表的大小. 首先选中数据库,可以通过手工选择,也可通过在新建查询窗口通过语句选择.通过语句选择的命令为 Use DataBaseName go 选择对应数据库后,在新建查询窗口执行以下语句即可查询该数据库大小: exec sp_spaceused; 查询数…