22,209
社区成员
发帖
与我相关
我的任务
分享
--try
select * from
(select count(*) as tablen from sys.tables) a
,
(select count(*) as tablev from sys.views) b
select sum(case type when 'U' then 1 else 0 end) as tablen,
sum(case type when 'V' then 1 else 0 end) as tablev
from sysobjects
tablen tablev
131 362
本机测试结果
select sum(case type when 'U' then 1 else 0 end) as tablen, --,号
sum(case type when 'V' then 1 else 0 end) as tablev
from bkysbase.dbo.sysobjects
select sum(case type when 'U' then 1 else 0 end) as tablen
sum(case type when 'V' then 1 else 0 end) as tablev
from bkysbase.dbo.sysobjects