Returns the page size, in bytes, for the specified object.
pagesize(object_name [, index_name])
Or:
pagesize(object_id [,db_id [, index_id]])
the name of the object whose page size this function returns.
indicates the name of the index whose pagesize you want returned.
the ID of the object whose page size this function returns.
the ID of the database in which the object with object_name resides.
the ID of the index whose page size you want returned.
Selects the pagesize for the title_id index in the current database.
select pagesize("title", "title_id")
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)
The following all default to the current database:
select pagesize(1234, null, 2) select pagesize(1234)
Selects the pagesize for the titles table (object_id 224000798) from the pubs2 database (db_id 4):
select pagesize(224000798, 4)
Returns the pagesize for the non-clustered index’s pages table mytable, residing in the current database:
pagesize(object_id(‘mytable’), NULL, 2)
Returns the page size for object titles_clustindex from the current database:
select pagesize("titles", "titles_clustindex")
pagesize defaults
to the data layer if you do not provide an index name or index_id (for
example, select pagesize("t1”)
)
of if you use the word “null” as a parameter (for
example, select pagesize("t1", null)
.
If the specified object is not an object requiring physical data storage for pages (for example, if you provide the name of a view), pagesize returns zero.
If the specified object does not exist, pagesize returns NULL.
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute pagesize.