我需要查看一个特定所有者/创建者下存在的表的数量。
我该怎么做?
我正在使用SQL Server 2008。
答案 0 :(得分:0)
使用yourdb;
SELECT count(*)
FROM INFORMATION_SCHEMA.Tables
where table_type like '%base table%'
答案 1 :(得分:0)
select table_schema,
COUNT(*)
from information_schema.Tables
where table_type = 'BASE TABLE'
AND table_schema = 'myschema' -- replace this with the schema/owner you are looking for
group by table_schema