row_count

Description

Returns an estimate of the number of rows in the specified table.

Syntax

row_count(dbid, object_id [,ptnid])

Parameters

dbid

is the the database ID where target object resides

object_id

is the object ID of table

ptnid

is the partition ID of interest

Examples

Example 1

Returns an estimate of the number of rows in the given object:

select row_count(5, 31000114)

Example 2

Returns an estimate of the number of rows in the specified partition (with partition ID of 2323242432) of the object with object IDof 31000114:

select row_count(5, 31000114, 2323242432)

Usage

All erroneous conditions will return in a value of zero being returned.

Standards

ANSI SQL – Compliance level: Transact-SQL extension

Permissions

Any user can execute row_count.

See also

Functions reserved_pages, used_pages