col_length

Description

Returns the defined length of a column.

Syntax

col_length(object_name, column_name)

Parameters

object_name

is name of a database object, such as a table, view, procedure, trigger, default, or rule. The name can be fully qualified (that is, it can include the database and owner name). It must be enclosed in quotes.

column_name

is the name of the column.

Examples

Example 1

Finds the length of the title column in the titles table. The “x” gives a column heading to the result:

select x = col_length("titles", "title")

 x
---- 
   80

Usage

Standards

SQL92 – Compliance level: Transact-SQL extension.

Permissions

Any user can execute col_length.

See also

Function datalength