Last active
August 30, 2017 17:53
-
-
Save hesenger/5364c308c147299f7c8f01088223b2a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT CONCAT(SC.NAME, '.', TA.NAME) TABELA, | |
FORMAT(SUM(PA.ROWS), 'N0') LINHAS, | |
(SELECT CONCAT(CC.NAME, '; ') FROM SYS.COLUMNS CC WHERE CC.object_id = TA.object_id FOR XML PATH('')) COLUNAS | |
FROM SYS.TABLES TA | |
INNER JOIN SYS.PARTITIONS PA ON PA.OBJECT_ID = TA.OBJECT_ID | |
INNER JOIN SYS.SCHEMAS SC ON TA.SCHEMA_ID = SC.SCHEMA_ID | |
INNER JOIN SYS.COLUMNS C ON C.OBJECT_ID = TA.OBJECT_ID | |
WHERE TA.IS_MS_SHIPPED = 0 AND PA.INDEX_ID IN (1,0) | |
AND TA.NAME NOT LIKE '%HIDL%' | |
GROUP BY SC.NAME,TA.NAME,TA.object_id | |
ORDER BY SUM(PA.ROWS) DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment