用户表:select count(*) 总表数 from sysobjects where xtype='u'
刚才那个是用户表,下面这个是系统表加用户表:
select count(*) 总表数 from sysobject s 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查询来统计数据库中各种对象数量的方法,包括用户表、系统表、视图、存储过程和触发器等。

被折叠的 条评论
为什么被折叠?



