MS SQL List of Records in All Tables

In MS SQL, run the following code to get the list of record numbers of all tables (created by the user) in a database.

SELECT [TableName] = sobj.name, [RowCount] = MAX(sind.rows) FROM sysobjects sobj, sysindexes sind WHERE sobj.xtype = 'U' AND sind.id = OBJECT_ID(sobj.name) GROUP BY sobj.name ORDER BY 2 DESC


You May Interest

Using MS SQL If Else

Adding Columns to a Table with a Query in MS SQL

MS SQL Finding Which Tables a Column Name is In

How is Deadlock Different From a Blocking Situation in SQL Server ...

How is Change Tracking is Different From Change Data Capture ?