Batch query to get a record count for all tables in a database
06 Jan 2012
TutorialT-sql
I needed to get a quick record count for all the tables in a particular database that contains around about 100 tables. I didn't want to waste time selecting the count for each table individually, so I knocked up a quick query that would loop through all the tables in the database (using **sp_MSforeachtable**) and ordered it by the total record count. You may find the query useful. Cheers