magritton
12/22/2017 - 4:50 PM

SQL From Count No Count

Counts the rows in a table when you cannot use Count()

Select si.RowCnt
from sys.objects so join sysindexes si on si.id = so.object_id
where so.type_desc = 'USER_TABLE'
and si.indid in (0,1) -- heap or clustered index
and so.Name in ('Users')