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 2005 Forums
 Transact-SQL (2005)
 Retrieve table rowcount from every database

Author  Topic 

reddy_vam
Starting Member

43 Posts

Posted - 2008-07-27 : 12:06:50
Hi When i use sys indexes to get the rowcount from each database,
it was picking up duplicate table name by indid(0,1,2), but i want to pick only one of them, i am not sure which one i have to pick,
i appriciate your suggestions.

Thanks,
Vamshi

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-27 : 12:38:01
This will give you row count as well as size for all tables.

Use databasename
Exec sp_Msforeachtable @command1 = 'sp_spaceused ''?'''
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-27 : 13:41:15
http://www.sqlservercentral.com/scripts/Miscellaneous/30679/
Go to Top of Page

reddy_vam
Starting Member

43 Posts

Posted - 2008-07-27 : 22:23:42
Thanks alot Visakh & Sodeep, its working now.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-07-28 : 04:19:28
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/11/02/different-ways-to-count-rows-from-a-table.aspx

Madhivanan

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

- Advertisement -