data_pages

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.

Syntax

data_pages(dbid, object_id [, indid [, ptnid]])

Parameters

Examples

Usage

In the case of an APL (all-pages lock) table, if a clustered index exists on the table, then passing in an indid of:
  • 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.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute data_pages.

Related reference
object_id
row_count