分类: 数据库开发技术
2012-08-20 10:16:11
快速查找用户表记录数
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 a.name ASC
快速查找用户表记录数——单个表
SELECT a.name, b.rows
FROM sysobjects a WITH(NOLOCK)
JOIN sysindexes b WITH(NOLOCK)
ON b.id = a.id
WHERE a.id = object_id( '表名 ') and a.xtype = 'U ' AND b.indid IN (0, 1)
ORDER By a.name ASC
sp_spaceused 表名