Please Share your Product Ideas with us!

All ideas are welcome. Just because the Idea doesn't make it into the product immediately does not make it a bad idea.

New System View "boaTableCounts" for databases to show Table Record counts

BOAUnited

In Data Source Registry (and Admin > Datasources), we need a new "System View" to be created in the database (when System Views is checked) that shows the count of records in all tables.  Here is the SQL to use:

 

CREATE VIEW [dbo].[boaTableCounts]

AS

SELECT     TOP (100) PERCENT INFORMATION_SCHEMA.TABLES.TABLE_CATALOG, INFORMATION_SCHEMA.TABLES.TABLE_NAME,

                      sys.sysindexes.rowcnt AS RecordCount

FROM         sys.sysobjects INNER JOIN

                      sys.sysindexes ON sys.sysobjects.id = sys.sysindexes.id INNER JOIN

                      INFORMATION_SCHEMA.TABLES ON sys.sysobjects.name = INFORMATION_SCHEMA.TABLES.TABLE_NAME

WHERE     (sys.sysobjects.xtype = 'U') AND (sys.sysindexes.indid IN (0, 1))

  • Guest
  • Jan 31 2017
  • Unlikely to Implement
  • May 12, 2017

    Admin response

    Could you add more about the problem you are solving with this in order for us to better understand.  Row Count of tables isn't a hard thing to find out in SQL.  Is this something you were just tired of writing the SQL for?

  • Attach files
  • +1