|
partition_name()
The
system function
partition_name() returns the name of a specified
partition.
If the specified partition does not exist, the return value is
NULL.
The function partition_name() is available in
ASE
starting with version 15.0.
Syntax of the System Function partition_name()
partition_name(index_id, partition_id [,db_id])
The Parameters of the System Function partition_name()
The function partition_name() can be executed across databases using the
optional parameter "db_id".
If this parameter is not specified, partition_name() is
executed in the current
database.
"index_id"
The parameter "index_id" is the identification number of an
index.
The "index_id" can be retrieved from the
column
"indid" in the
system table
sysindexes
"index_id" can be used alternatively to "partition_name".
"partition_id"
The parameter "partition_id" is the indentification number of a
partition.
The "partition_id" can be retrieved from the column
"partitionid" of the system table
syspatitions.
"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
system table
sysdatabases
or determined using the
stored procedure
sp_helpdb.
Example for the System Function partition_name()
select partition_name(1, 1234567890)
go
In the current
database,
determines the name of the partition with the identification number
"1234567890", where a table and an index with
index_id = "1" is located.
select partition_name(1, 1234567890, db_id("user_db")
go
In the database "user_db", determines the name of the partition
with the identification number "1234567890", where a table and
an index with index_id = "1" is located.
The function partition_name() can be used across databases to find names
for partitions.
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().
|