查询数据库里有多少张表、视图、存储过程

sql server 数表:
select count(1) from sysobjects where xtype='U'  --后面可以接name='tableName' 查询是否包含某一指定表
数视图:
select count(1) from sysobjects where xtype='V'
数存储过程
select count(1) from sysobjects where xtype='P'

原文地址:https://www.cnblogs.com/wangpf/p/3014678.html