SQL Server 查询库中所有表的数据行数

2018年1月22日14:54:58
  • SQL Server 查询库中所有表的数据行数已关闭评论
  • 221 views
  • A+
所属分类:SqlServer

SELECT a.name, b.rows

FROM sysobjects AS a INNER JOIN sysindexes AS b ON a.id = b.id

WHERE (a.type = 'u') AND (b.indid IN (0, 1))

ORDER BY b.rows DESC

avatar