# Miscellaneous > General Database Discussions >  character length in SQL

## Jodi

What is the syntax to count the # of characters in any given field in Transact SQL?

----------


## Levi Akers

Jodi,
If you do it in a select statement it is simply:  
select LEN(<char field name>) from <table name> ...

One thing I use LEN( ) for is to find the longest set of chars in a column that is simply:
select MAX(LEN(<char field name>)) from <table name> ...
the same could be done to find the shortest.

Hope this helps.

Levi
BrainBuzz.com
Mother of All Tech Sites

------------
Jodi at 12/29/99 11:29:57 AM


What is the syntax to count the # of characters in any given field in Transact SQL?

----------

