How to fetch the row count for all tables in a SQL SERVER database

The following SQL will get you the row count of all tables in a database:

The output will be a list of tables and their row counts.

If you just want the total row count across the whole database, appending:

will get you a single value for the total number of rows in the whole database.

Source: How to fetch the row count for all tables in a SQL SERVER database – Stack Overflow

Leave a Reply