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



Tools

Troubleshoot SQL Server Performance


Compare and Sync SQL Server Databases


Import & Export SQL Server Data


Schedule SQL Server Express Backups







Articles

Advantages of SQL Server 64-bit


Understanding SQL Server Blocking & Deadlocks


SQL Server Memory Internals

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