标签:obj where sed dex gif one font 数据库 tab
1 //查询所有表明 select name from sysobjects where xtype=‘u‘ 2 3 select * from sys.tables 4 //查询数据库中所有的表名及行数 5 6 SELECT a.name, b.rows 7 8 FROM sysobjects AS a INNER JOIN sysindexes AS b ON a.id = b.id 9 10 WHERE (a.type = ‘u‘) AND (b.indid IN (0, 1)) 11 12 ORDER BY a.name,b.rows DESC 13 14 //查询所有的标明及空间占用量\行数 15 16 select 17 18 object_name(id) tablename, 19 20 8*reserved/1024 reserved, 21 22 rtrim(8*dpages)+‘kb‘ used, 23 24 8*(reserved-dpages)/1024 unused, 25 26 8*dpages/1024-rows/1024*minlen/1024 free, 27 28 rows 29 30 --,* 31 32 from sysindexes 33 34 where indid=1 35 36 order by tablename,reserved desc
标签:obj where sed dex gif one font 数据库 tab
原文地址:https://www.cnblogs.com/yangdunqin/p/sqlchabiao.html