SQL Server查询库中有哪些空表或非空表

/* select
t.name table_name,s.name schema_name,sum(p.rows) total_rows
from
sys.tables t
join sys.schemas s on (t.schema_id = s.schema_id)
join sys.partitions p on (t.object_id = p.object_id)
where p.index_id in (0,1)
group by t.name,s.name
having sum(p.rows) > 100;

查询行数>100的表。若=0,则为查询空表 */

  

posted @ 2022-04-19 11:31  西泽Xiz  阅读(589)  评论(0编辑  收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css