Technical Article

Find Number of Rows in all User Tables

,

This query would give the number of rows in all user tables.

select    [Owner] = left(user_name(objectproperty(id, 'OwnerId')), 35)
        , [Table] = left(object_name(id), 65)
        , [Count] = rows
from dbo.sysindexes
where indid                             < 2
  and objectproperty(id, 'IsUserTable') = 1

order by 1,2

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating