reserved_pgs

Description

Returns the number of pages allocated to the specified table or index, and reports pages used for internal structures.

Syntax

reserved_pgs(object_id, {doampg | ioampg})

Parameters

object_id

is a numeric expression that is an object ID for a table, view, or other database object. These are stored in the id column of sysobjects.

doampg | ioampg

specifies table (doampg) or index (ioampg).

Examples

Example 1

Returns the page count for the syslogs table:

select reserved_pgs(id, doampg)
from sysindexes where id = 
    object_id("syslogs")
-------------
         534 

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute reserved_pgs.

See also

Commands update statistics

Functions data_pgs