use lxxTest
go
SELECT name FROM 库.sys.tables —获取数据库下的表名称
select count(*) 用户表 from sysobjects where xtype='u'
select count(*) 总表数 from sysobjects where xtype in('u','s')
select count(*) 总视图数 from sysobjects where xtype='v'
select count(*) 总存储过程数 from sysobjects where xtype='p'
select count(*) 总触发器数 from sysobjects where xtype='tr'
SELECT count(*) 数据库作业 FROM msdb.dbo.sysjobs
Sql获取当前数据库统计详情
于 2022-04-28 14:58:17 首次发布