Returns the number of pages used by the specified table, index, or a specific partition. The result does not include pages used for internal structures.
This function replaces data_pgs and ptn_data_pgs from versions of SAP ASE earlier than 15.0.
data_pages(dbid, object_id [, indid [, ptnid]])
select data_pages(5, 31000114)
select data_pages(5, 31000114, 0)
select data_pages(5, 31000114, 1)
select data_pages(5, 31000114, 0, 2323242432)
0 – reports the data pages.
1 – reports the index pages.
All erroneous conditions return a value of zero, such as when the object_id does not exist in the current database, or the targeted indid or ptnid cannot be found.
Instead of consuming resources, data_pages discards the descriptor for an object that is not already in the cache.
See also sp_spaceused in Reference Manual: Procedures.
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute data_pages.