thespot4sap.com independent sap information
 

get SAP Access - pay monthly

SAP Tutorials    Online SAP Training    SAP CBT's    Forums    SAP Articles    SAP Jobs    Resumes
  SAP Access    SAP Blogs    SAP Books     Links     Vendor Directory     Submit Content    Search
Previous posts in SAPscript
Page 261 of 5524

Script to List Row Counts of All Tables

Blogger : MSDN Blogs
All posts : All posts by MSDN Blogs
Category : SAPscript
Blogged date : 2008 Oct 02

Something I had a use for the other day that I thought I would share.  The following script can be run as-is against any SQL Server database, and will list one row per table and give you the row (record) count for each table.  The results are sorted and returned as a single result set instead of multiple result sets as would happen if you used sp_MSforeachtable.  The table count is not based on statistics, but rather based on actual counts.  It uses a dirty read (read uncommitted) so as to not lock the table.  I found this useful in a replication topology where I needed to generate a report comparing the counts between subscribers and publisher (you can use replication validation, but we needed actual counts more for a "sanity check").


Read comments or post a reply to : Script to List Row Counts of All Tables
Page 261 of 5524

Newest posts
New Page 1

 

 

About Us   Contact Us   Privacy   Disclaimer   Feedback   Email Discussion   Newsletter  

Copyright © - Independent SAP Information
Learn XML, Guesthouses and B&B's