【鎶琛?sh霉)璩囨枡】…………………………………………………………………………………………>>> |
|
Mssql-server查詢數(shù)據(jù)的所有表名和行數(shù) |
|
MsSQL Server查詢數(shù)據(jù)的所有表名和行數(shù)
1、查詢所有表名 select name from sysobjects where xtype=''u'' select * from sys.tables
2、查詢數(shù)據(jù)庫中所有的表名及其行數(shù) SELECT a.name, b.rows FROM sysobjects AS a INNER JOIN sysindexes AS b ON a.id = b.id WHERE (a.type = ''u'') AND (b.indid IN (0, 1)) ORDER BY a.name,b.rows DESC
3、查詢所有的標明及空間占用量\行數(shù) select object_name(id) tablename, 8*reserved/1024 reserved, rtrim(8*dpages)+''kb'' used, 8*(reserved-dpages)/1024 unused, 8*dpages/1024-rows/1024*minlen/1024 free, rows ,* from sysindexes where indid=1 order by tablename,reserved desc |
發(fā)布時間:2018/1/6
閱讀:9245次 來源:互聯(lián)網(wǎng) |
|
|
|
|