Technical Article

User Tables and their row count

,

Returns the Owner, Table Name, Row count for all user tables in the current database.

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