源码如下
--怎么查询一个数据库里有多少张表
--先指定数据库
use canyin
go
--查询该数据库有几张表
select COUNT(*) from sysobjects where xtype='U'

查询效果如下