data_pgs( [db_id,] object_id, {doampg | ioampg} )
Returns the number of pages used by the table (doampg) or index (ioampg)
Examples
select name as IndexName, data_pgs(Id, doampg) as NrOfPagesInTable
from sysindexes
where id = Object_Id('T_ProdBillOfMat')
and indid = 0
select name as IndexName, data_pgs(Id, ioampg) as NrOfPagesInIndex,
case indid when 255 then 'Text pointer chain' else '' end as Remark
from sysindexes
where id = Object_Id('T_ProdBillOfMat')
and indid <> 0