Wednesday, 1 August 2012

Number of rows/records in all the tables in SQL Server

A small post, to get the number of records from all the tables from SQL Server, try the below SQL query.

SELECT '[' + SCHEMA_NAME(t.schema_id) + '].[' + + ']' AS fulltable_name, SCHEMA_NAME(t.schema_id) AS schema_name, AS table_name,
FROM sys.tables AS t INNER JOIN
sys.sysindexes AS i ON t.object_id = AND i.indid < 2


No comments:

Post a Comment