[Script Of Mar. 17] How to get the table row count for all tables in a SQL Server database (T-SQL)

image

Mar.

17

image

image

Script Download:   
The script is available for download from https://gallery.technet.microsoft.com//How-to-get-the-table-row-f2dc9cfa.  You can also use  Microsoft Script Browser for Windows PowerShell ISE to download the sample with one button click from within your scripting environment.

This T-SQL script will demonstrate how to get the table row count for all tables in a SQL Server database.

As many people asked how to get the table row count for all tables in a SQL Server database, we provide this script for reference. Getting the row count is based on a condition: index_id < 2 (0: heap, 1: clustered index).

You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery