Returns the name of the column where the table and column IDs are specified, and can be up to 255 bytes in length.
col_name(object_id, column_id [, database_id])
is a numeric expression that is an object ID for a table, view, or other database object. These are stored in the id column of sysobjects.
is a numeric expression that is a column ID of a column. These are stored in the colid column of syscolumns.
is a numeric expression that is the ID for a database. These are stored in the db_id column of sysdatabases.
select col_name(208003772, 2)
------------------------------ title
col_name, a system function, returns the column’s name.
For general information about system functions, see “System functions”.
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute col_name.
Copyright © 2005. Sybase Inc. All rights reserved. |