from: http://blog.sina.com.cn/s/blog_5fca93140100dcu9.html
我们通常的做法是:select count(*) as c from tableA 。然而对于记录数巨大的表,上述做法将会非常耗时。
在MS SQL 数据库中每个表都在sysindexes 系统表中拥有至少一条记录,该记录中的rows 字段会定时记录表的记录总数。下面是sysindexes 表的相关记录的含义:
列名
id
Indid
rows
只需执行如下语句:
select rows from sysindexes where id = object_id('Products') and indid in (0,1)
//'Products'表名称