Home Products Support Sales Corporate
Products
Performance Monitor
Database Compare
Database Manager
Job Scheduler






Home > Articles > SQL Server Administration > How many rows does your largest SQL Server table contain?

How many rows does your largest SQL Server table contain?

Often database administrators and users want to know how many rows are there in each table or how big is the largest table in the database. Run the following sql batch from the SQL window in Teratrax Database Manager to generates a list of all tables in your database together with the number of rows in each one. The list is sorted by table name but you can easily change the ORDER BY clause to sort it by the number of rows:

 

 

Syntax

USE db1
SELECT o.name as [Name], i.rowcnt as [Row Count]
FROM sysindexes i
INNER JOIN sysobjects o ON i.id = o.id
WHERE indid < 2 AND o.xtype = 'U'
ORDER BY Name

 



Privacy Statement License Agreement Articles Site Map         Copyright © 2002-2008 Teratrax Inc. All rights reserved.