Export (0) Print
Expand All
ABS
ALL
AND
ANY
AVG
bit
COS
COT
DAY
EXP
GO
IN
LEN
LOG
MAX
MIN
NOT
OR
PI
SET
SIN
STR
SUM
TAN
USE
VAR
Expand Minimize
2 out of 2 rated this helpful - Rate this topic

COL_LENGTH

SQL Server 2000

Returns the defined length (in bytes) of a column.

Syntax

COL_LENGTH ( 'table' , 'column' )

Arguments

'table'

Is the name of the table for which to determine column length information. table is an expression of type nvarchar.

'column'

Is the name of the column for which to determine length. column is an expression of type nvarchar.

Return Types

int

Examples

This example shows the return values for a column of type varchar(40) and a column of type nvarchar(40).

USE pubs
GO
CREATE TABLE t1
   (c1 varchar(40),
    c2 nvarchar(40)
)
GO
SELECT COL_LENGTH('t1','c1')AS 'VarChar',
      COL_LENGTH('t1','c2')AS 'NVarChar'
GO
DROP TABLE t1

Here is the result set.

VarChar     NVarChar
40          80

See Also

Expressions

Metadata Functions

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.