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

Getting List of System Hard Disks with Free Space in MS SQL Serve ...

What is the Maximum Number of Columns a Table in SQL Server ?

How to Optimize Stored Procedure in SQL Server ?

Where are SQL Server Usernames and Passwords Stored in the SQL Se ...

What is the Bookmark Lookup and RID Lookup in SQL Server ?