-- 获取所有数据库名
select * from master..SysDatabases;

-- 获取hotline数据库中所有表名
select name from hotline..SysObjects where xType='U' order by name; -- xType='U'所有用户表;xType='S'所有系统表

-- 获取所有字段名
select name from SysColumns where id = OBJECT_ID('BLOB')

-- 查询各个磁盘分区的剩余空间
Exec master.dbo.xp_fixeddrives

 

-- 查看数据库中,各个表多少行
SELECT A.NAME ,B.ROWS 
FROM sysobjects A JOIN sysindexes B 
ON A.id = B.id 
WHERE A.xtype = 'U' AND B.indid IN(0,1)  and b.rows >0
ORDER BY B.ROWS DESC

 

参考自:https://blog.csdn.net/feng19821209/article/details/6388857

链接中的查询更多一些!

 

谢谢

相关文章: