SQL Server 查詢資料庫中所有的表名及行數

衣舞晨風發表於2016-05-04
SELECT a.NAME
    ,b.rows
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

作者:jiankunking 出處:http://blog.csdn.net/jiankunking

相關文章