T-SQL Tutorial

SQL Len


Len Syntax:

SELECT LEN(column_name)
FROM table_name

Students table:

IDNAMEState
1TomArizona
2LindaTexas
3HelenFlorida
4RobertCalifornia

Len Example:

SELECT state, LEN(state)
FROM students;

Len Result:

StateLEN(state)
Arizona7
Texas5
Florida7
California10