pagesize

Description

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

Syntax

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

Parameters

object_name

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

index_name

indicates the index name of the page size you want returned.

object_id

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

db_id

is the database ID of the object.

index_id

is the index ID of the object you want returned.

Examples

Example 1

Selects the page size for the title_id index in the current database.

select pagesize("title", "title_id")

Example 2

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 previous example defaults to the current database):

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

Example 3

All default to the current database:

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

Example 4

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

select pagesize(224000798, 4)

Example 5

Returns the page size for the nonclustered 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.