//查詢全部代表
select name from sysobjects where xtype='u'數據庫
select * from sys.tablestable
//查詢數據庫中全部的表名及行數sed
SELECT a.name, b.rowsobject
FROM sysobjects AS a INNER JOIN sysindexes AS b ON a.id = b.idselect
WHERE (a.type = 'u') AND (b.indid IN (0, 1))im
ORDER BY a.name,b.rows DESC數據
//查詢全部的標明及空間佔用量\行數查詢
selecttab
object_name(id) tablename,di
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