/ Published in: SQL
This will return a list of all the tables in a certain database along with their row count.
Expand |
Embed | Plain Text
SELECT DISTINCT convert(varchar(30),object_name(a.id)) [TABLE Name], a.rows FROM sysindexes a INNER JOIN sysobjects b ON a.id = b.id INNER JOIN INFORMATION_SCHEMA.TABLES c ON c.[TABLE_NAME]=convert(varchar(30),object_name(a.id)) WHERE c.Table_catalog='DATABASE NAME'
You need to login to post a comment.
