在sql server查看所有表的行数

在sql server查看所有表的行数:

SELECT a.name,b.rows
FROM sysobjects a WITH (NOLOCK)
JOIN sysindexes b WITH (NOLOCK) ON b.id = a.id
WHERE a.xtype = 'U'
    AND b.indid IN ( 0, 1 )
ORDER BY b.rows DESC;

猜你喜欢

转载自www.cnblogs.com/parkerchen/p/13387250.html