Script that provides the row counts and table names

后端 未结 7 1877
旧巷少年郎
旧巷少年郎 2021-02-05 10:24

Maybe you easily said how to I provide table names and row counts?

Pseudo SQL:

for \"select tablename from system.Tables\" into :tablename
  execute \"se         


        
7条回答
  •  时光取名叫无心
    2021-02-05 10:58

    SELECT 
    t.NAME AS TableName, p.[Rows] FROM 
    sys.tables t INNER JOIN
    sys.partitions p ON t.object_id = p.OBJECT_ID GROUP BY 
    t.NAME, p.[Rows] ORDER BY    t.NAME
    

提交回复
热议问题