I want to find the longest VARCHAR in a specific column of a SQL Server table.
VARCHAR
Here\'s an example:
ID = INT IDENTITY DESC = VARCHAR(5000) I
For sql server (SSMS)
select MAX(LEN(ColumnName)) from table_name
This will returns number of characters.
select MAX(DATALENGTH(ColumnName)) from table_name
This will returns number of bytes used/required.
IF some one use varchar then use DATALENGTH.More details
DATALENGTH