select DB_NAME()+'.'+C.NAME+'.'+A.Name as [TableName],B.TotalRows from sys.objects A Inner Join
(Select sum(rows) as TotalRows,object_ID from sys.partitions group by object_Id) b on A.object_id=B.object_id
INNER JOIN Sys.schemas C on C.SCHEMA_ID=A.schema_id
where type= 'U' order by C.Name,A.Name
Note: I have seen some people mention online that the only accurate way of finding the row count is by doing count on the actual table itself.I could not verify this but may be something to keep in mind.
Hello Everyone. My intention of having this site is to have one repository location for my SQL Server Learning's. Most of the information here is already available on Web but I want to have it in one global location, so I can reference whenever I need . I would be more than happy, if you find anything on this blog useful. Also, Please use your own caution when running any code on your systems.Thank you for visiting.
View all posts by SQLWhisperer