|
partition_object_id()
The
system function
partition_object_id() returns the
object identification number of the specified
partition.
If the parameter "partition_id" or "db_id" is specified as
NULL,
the return value will also be NULL. The same is valid if the
"partition_id" or "db_id" does not exist.
The function partition_object_id() is available in
ASE
starting with version 15.0.1.
Syntax of the System Function partition_object_id()
partition_object_id(partition_id [,db_id])
The Parameters of the System Function partition_object_id()
The function partition_object_id() can be used across databases by
specifying the optional parameter
"db_id". If the parameter
"db_id" is not set, partition_object_id() is
executed in the current
database.
"partition_id"
The parameter "partition_id" is the identification number (id)
of a partition.
The "partition_id" can be retrieved from the column
"partitionid" in the
system table
syspartitions.
"db_id"
This is the identification number of the
database,
in which the object is stored. The db_id can be retrieved from the
column
dbid in the
sytem table
sysdatabases
or using the
stored procedure
sp_helpdb.
Example for the System Function partition_object_id()
select partition_object_id(2)
go
In the current
database,
determines the id of the object with the "partition_id" of 2.
select partition_object_id(2, 4)
go
Determines the id of the object with the "partition_id" of 2
in the database with dbid 4.
select partition_object_id(2, NULL)
go
Returns
NULL,
because the parameter "db_id" is defined as NULL.
See also:
ASE T-SQL - Aggregate Functions, audit_event_name(), col_length(), col_name(), curunreservedpgs(), datachange(), datalength(), data_pages(), data_pgs(), db_id(), db_name(), host_id(), host_name(), identity(), index_col(), index_colorder(), isnull(), lct_admin(), license_enabled(), lockscheme(), next_identity(), object_id(), object_name(), pagesize(), pointer_size(), ptn_data_pgs(), reserved_pages(), reserved_pgs(), rowcnt(), row_count(), showplan_in_xml(), syb_sendmsg(), syb_sendmsg(), System Functions, tempdb_id(), tran_dumpable_status(), tsequal(), used_pages(), used_pgs().
|