SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Find all published tables with row counts and table size

By Jim Youmans,

Sometimes you need to list all the tables that are being published on a server.  Once you have the list it is really nice to have the table sizes too (row count and total MBs for table).  This script will do the following.

  1. It looks at all the databases, finds the ones that are published
  2. Then if grabs the row counts and table sizes for tables in those databases
  3. Then compares that to the articles in the publications and gives you a nice easy to read report

Please Note: This assumes no filters on the publication.  If you have a very large table and are only replicating 5 of 60 columns, if will not see that and will give you the numbers for the entire table.

Total article views: 405 | Views in the last 30 days: 7
 
Tags
replication    
sql    
 
Contribute