Skip to content

Instantly share code, notes, and snippets.

@amimaro
Last active March 16, 2018 12:54
Show Gist options
  • Save amimaro/a49875998a36847c87c60d477ff88eb6 to your computer and use it in GitHub Desktop.
Save amimaro/a49875998a36847c87c60d477ff88eb6 to your computer and use it in GitHub Desktop.
Some MSSQL Queries
-- Query count rows from tables
SELECT T.name AS tableName,
I.rows AS rowCount
FROM sys.tables AS T
INNER JOIN sys.sysindexes AS I
ON T.object_id = I.id
AND I.indid < 2
ORDER BY I.rows DESC
Some MSSQL Queries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment