传统做法可能是select count(1)
但是往往会比较慢。推荐如下做法:
1 SELECT ISNULL(MAX(rowcnt), 0) CurrentRowCount 2 FROM sys.sysindexes 3 WHERE id = OBJECT_ID('TableName')