0
点赞
收藏
分享

微信扫一扫

快速获取表的记录数


可以这样写:

use [mydb]
go

select rows from sysindexes where id = object_id('表名') and indid in (0,1);



indid

smallint

索引 ID:

0 = 堆

1 = 聚集索引

> 1 = 非聚集索引


这样就不必写出 select count(*) from 表 这样耗费资源的语句了。

举报

相关推荐

0 条评论