0

I want production optimized query to return each row count and size for each database table in an instance

Like: DATABASE/CATALOG_NAME TABLE_NAME RECORD_COUNT SIZE(Bytes/KB/MB)

tarunM
  • 127
  • 2
  • 6

1 Answers1

0

What version of SQL Server are you using?

SSMS has a built in report that will just do that. You can export the report to excel.

What is better than that?

Check out this post from Buck Woody. If you get to see him talk, please go. Here is a very good presenter.

http://blogs.msdn.com/b/buckwoody/archive/2007/12/14/sql-server-management-studio-standard-reports-disk-usage-by-table-top-tables.aspx

CRAFTY DBA
  • 14,351
  • 4
  • 26
  • 30
  • I have mentioned version as 2000. Also the bucky links is not working.Thanks – tarunM Mar 13 '14 at 20:36
  • I have mentioned version as 2000. Also the bucky links is not working. – tarunM Mar 13 '14 at 20:36
  • Jeff Moden is another SQL Server MVP - Check out his solution here. http://stackoverflow.com/questions/5186967/sql-server-2000-how-do-i-get-a-list-of-tables-and-the-row-counts – CRAFTY DBA Mar 13 '14 at 20:38
  • I have tried suggested comments on this post but it always shows data from only one custom database. I don't know why there is no data present in 'sysobjects' table for other custom database. Is there any way we can see data for other custom database? – tarunM Mar 18 '14 at 22:06
  • Jeff Modens script runs in the currently selected database. Execute the USE statement to select a database of your choosing. http://technet.microsoft.com/en-us/library/ms188366.aspx – CRAFTY DBA Mar 19 '14 at 13:59