Wahyu Kurniawan Blog


Some of your need maybe at here





See also: Other Geeks@INDC

February 2010 - Posts

Get Row Count for Each Table in SQL Server
Whooooaahhhh... so long i didn't touch my blog. For the first post 2010, I want to share a query to know row count for each table in SQL Server. Here you are:

SELECT
[TableName] = so.name,
[RowCount] = MAX(si.rows)
FROM
sysobjects so,
sysindexes si
WHERE
so.xtype = 'U'
AND
si.id = OBJECT_ID(so.name)
GROUP BY
so.name
ORDER BY
2 DESC

I forgot from where i got this query, enjoy it.
Share this post: | | | |
Posted: Feb 23 2010, 09:03 AM by wahyukurniawan | with no comments
Filed under: