Snippets

Ian R-P MSSQL: Find number of rows per table for entire database

Created by Ian R-P
1
2
3
4
5
6
7
8
9
SELECT 
    so.name, si.rows
FROM
    sysobjects so INNER JOIN sysindexes si ON si.id = si.id
WHERE
    so.type = 'U' AND si.IndId < 2
ORDER BY
    so.Name
    --sysindexes.rows desc

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.