Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Row count for Tables

Author  Topic 

ladiaocb
Yak Posting Veteran

57 Posts

Posted - 2005-10-10 : 17:35:33
Need help. I need a query that will give me the row count for each table in a database. I'm not sure if this info is already stored in a table (i.e. msdb). As always thx in advance!!

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2005-10-10 : 17:48:38
DBCC CHECKDB will do this. And very handily, it also checks the consistency and integrity of the database in the process.

---------------------------
EmeraldCityDomains.com
Go to Top of Page

ladiaocb
Yak Posting Veteran

57 Posts

Posted - 2005-10-10 : 17:56:14
Sweet!! I knew there was something like this out there. THANKS!
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-10-11 : 05:25:25
There's a script at

http://www.databasejournal.com/scripts/print.php/1450801

which will give you table rows, and size used, in order of size and also alphabetically.

Kristen
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-12 : 03:13:37
Is this helpful?

select object_name(id),rows from sysindexes where indid<2 order by 1


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -