可以这样写:
use [mydb]goselect rows from sysindexes where id = object_id('表名') and indid in (0,1);
indid | smallint | 索引 ID: 0 = 堆 1 = 聚集索引 > 1 = 非聚集索引 |
这样就不必写出 select count(*) from 表 这样耗费资源的语句了。
本文共 237 字,大约阅读时间需要 1 分钟。
可以这样写:
use [mydb]goselect rows from sysindexes where id = object_id('表名') and indid in (0,1);
indid | smallint | 索引 ID: 0 = 堆 1 = 聚集索引 > 1 = 非聚集索引 |
这样就不必写出 select count(*) from 表 这样耗费资源的语句了。
转载于:https://www.cnblogs.com/leftfist/p/4258011.html