Friday, March 23, 2012

Number of records in all tables, all db's?

How can I easily (without looping) obtain the number of records in each of
my hundreds of tables in my dozens of SQL 2000 Database?
Tore
This will give you an approximation, provided that your usage stats are
current:
select
name
, rowcnt
from
sysindexes
where
indid in (0, 1)
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Tore Johnsen" <naturamo@.hotmail.com> wrote in message
news:eoPlAI7gEHA.2916@.TK2MSFTNGP12.phx.gbl...
How can I easily (without looping) obtain the number of records in each of
my hundreds of tables in my dozens of SQL 2000 Database?
Tore
|||Hi,
You could also use the below comand from query Analyzer:-
sp_MSforeachtable 'print ''?'' exec sp_spaceused ''?'''
Thanks
Hari
MCDBA
"Tore Johnsen" <naturamo@.hotmail.com> wrote in message
news:eoPlAI7gEHA.2916@.TK2MSFTNGP12.phx.gbl...
> How can I easily (without looping) obtain the number of records in each of
> my hundreds of tables in my dozens of SQL 2000 Database?
> Tore
>
>
sql

No comments:

Post a Comment