Row Count for all Tables in a database

Here is an easy way to get the row count for all tables in a database:

Note: Because of the use of the sys.tables and sys.partitions catalog views, the above code will work for SQL 2005 and newer.

One comment on “Row Count for all Tables in a database

  1. Code Highlighter on said:

    The code highlighter is awesome!

Leave a Reply

Your email address will not be published.

HTML tags are not allowed.