Counting rows for all tables at once

前端 未结 6 1974
梦毁少年i
梦毁少年i 2020-12-09 10:28

I\'m using SQL Server 2005 and would like to know how I can get a list of all tables with the number of records in each.

I know I can get a list of tables using the

6条回答
  •  离开以前
    2020-12-09 11:12

    I might add that sysindexes.rows is an approximation of the number of rows. I'd run a DBCC UPDATEUSAGE if you need a more accurate value. We had this issue on a DB with tables containing over 47-50 million rows and we thought we'd lost around half a million from each of them.

提交回复
热议问题