Profile

Monday, 6 June 2011

Find large tables in a database by row count

The following SQL query is use to list the number of tables within the database that exceed 10000 rows.

          USE AdventureWorksDW2008
          GO
          select distinct(O.[name]),I.ROWCNT
          FROM sysobjects O join sysindexes I ON O.[id] = I.[id]
          where I.rowcnt >10000