List Number of Rows per table

This script gives you an idea of how big the tables are

/*
DESCRIPTION    List the number of records per table
CONFIGURATION  Set the USE database section 
Author         Miguel Quintana  
 
Compatibility list:
MSSQL2005
MSSQL2008
MSSQL2000

 
*/
 
    USE [databasename]

select
substring(obj.name, 1, 50)        as Table_Name,
ind.rows                        as Number_of_Rows
from sysobjects as obj
inner join sysindexes as ind
on obj.id = ind.id
where obj.xtype = 'u'
and    ind.indid < 2
order by ind.rows desc

 

Leave a Reply

Your email address will not be published. Required fields are marked *