Counting The total Number Of Records In Your SMS Database Tables

  

This SQL query will simply count the number of records in the SMS SQL database for each table. You can modify it to report only the records found for a specific table by adding the line after the Where clause:

 

And SysObjects.Name = 'SoftwareFile'

 

SQL Query:

 

Select

 

SysObjects.Name 'Table Name',

Max (SysIndexes.Rows) 'Row Count'

 

From SysObjects, SysIndexes

 

Where SysObjects.XType = 'U'

And SysIndexes.Id = Object_Id(SysObjects.Name)

And SysIndexes.Rows <> 0

 

Group by SysObjects.Name, SysIndexes.Rows

 

 

Published Friday, December 29, 2006 10:32 PM by dhite
Filed under:

Comments

No Comments