Skip to content

Instantly share code, notes, and snippets.

@snahor
Created May 26, 2010 15:22
Show Gist options
  • Save snahor/414623 to your computer and use it in GitHub Desktop.
Save snahor/414623 to your computer and use it in GitHub Desktop.
-- SQL Server
SELECT [Tables] = so.name,
[Rows] = MAX(si.rows)
FROM sysobjects so,
sysindexes si
WHERE so.xtype = 'U'
AND si.id = OBJECT_ID(so.name)
GROUP BY so.name
ORDER BY 2 DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment