Click here to Skip to main content
15,892,537 members
Articles / Database Development

Record Count of Tables in SQL Server

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
26 Aug 2010CPOL 5.8K   3  
Also use either this one:SELECT OBJECT_NAME(SYSINDEXES.id), SYSINDEXES.rowcntFROM SYSINDEXES INNER JOIN SYSOBJECTS ON SYSINDEXES.id = SYSOBJECTS.idWHERE SYSINDEXES.indid < 2 AND SYSOBJECTS.xtype = 'U'or this one:SELECT OBJECT_NAME(id),rowcnt FROM SYSINDEXES WHERE...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
19 Feb 2010Md. Marufuzzaman
This is good... You can also consider this link.[^]
Please Sign up or sign in to vote.
16 Aug 2011Graham Cottle
Sometimes it is necessary to have the schema name included as well. I concatenate with the table name for my convenience, but it is not vital to do so.SELECT sys.sysindexes.rows, sys.schemas.name + '.' + sys.objects.nameFROM sys.objectsINNER JOIN sys.schemasON ...
Please Sign up or sign in to vote.
16 Aug 2011thatraja 4 alternatives  
The below query can be used to get the record count of all tables in the current database.
Please Sign up or sign in to vote.
26 Aug 2010Pranay Rana
Number of different ways to get total number of rows from tables

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions