欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

SqlServer统计

程序员文章站 2022-04-02 23:15:02
...
SELECT  a.name AS [TABLE NAME] ,
        b.rows AS [RECORD COUNT]
FROM    sysobjects AS a
        INNER JOIN sysindexes AS b ON a.id = b.id
WHERE   ( a.type = 'u' )
        AND ( b.indid IN ( 0, 1 ) )
ORDER BY a.name ,
        b.rows DESC