pagesize

Description

Returns the page size, in bytes, for the specified object.

Syntax

pagesize(object_name [, index_name])

Or:

pagesize(object_id [,db_id [, index_id]])

Parameters

object_name

the name of the object whose page size this function returns.

index_name

indicates the name of the index whose pagesize you want returned.

object_id

the ID of the object whose page size this function returns.

db_id

the ID of the database in which the object with object_name resides.

index_id

the ID of the index whose page size you want returned.

Examples

Example 1

Selects the pagesize for the title_id index in the current database.

select pagesize("title", "title_id")

Example 2

The following returns the page size of the data layer for the object with object_id 1234 and the database with a db_id of 2 (the last example defaults to the current database):

select pagesize(1234,2, null)
select pagesize(1234,2)
select pagesize(1234)

Example 3

The following all default to the current database:

select pagesize(1234, null, 2)
select pagesize(1234)

Example 4

Selects the pagesize for the titles table (object_id 224000798) from the pubs2 database (db_id 4):

select pagesize(224000798, 4)

Example 5

Returns the pagesize for the non-clustered index’s pages table mytable, residing in the current database:

pagesize(object_id(‘mytable’), NULL, 2)

Example 6

Returns the page size for object titles_clustindex from the current database:

select pagesize("titles", "titles_clustindex")

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute pagesize.