Thursday, December 5, 2019

Get Table Name with Row Count from SQL Database

Select the database you want to filter the information about the row count and run following SQL Statement

SELECT 
    T.NAME AS 'TABLE NAME',
    P.[ROWS] AS 'ROW COUNT'
FROM SYS.TABLES T 
INNER JOIN  SYS.PARTITIONS P ON T.OBJECT_ID=P.OBJECT_ID

This help me to know how many rows are there in table. Hope this will help you too.

No comments:

Post a Comment

Your feedback is always appreciated. I will try to reply to your queries as soon as time allows.Please don't spam,spam comments will be deleted upon reviews.