Returns an index name, when you provide the index ID, the database ID, and the object on which the index is defined.
index_name(dbid, objid, indid)
is the ID of the database on which the index is defined.
is the ID of the table (in the specified database) on which the index is defined.
is the ID of the index for which you want a name.
Illustrates the normal usage of this function.
select index_name(db_id("testdb"), object_id("testdb...tab_apl"),1) ------------
Illustrates the output if the database ID is NULL and you use the current database ID.
select index_name(NULL,object_id("testdb..tab_apl"),1) --------------------------
Displays the table name if the index ID is 0, and the database ID and object ID are valid.
select index_name(db_id("testdb"), object_id("testdb..tab_apl"),1) -----------------------------
index_name uses the current database ID, if you pass a NULL value in the dbid parameter
index_name returns NULL if you pass a NULL value in the dbid parameter.
index_name returns the object name, if the index ID is 0, and you pass valid inputs for the object ID and the database ID.
Any user can execute this function.