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
Watch out!! If there's spaces they will not be considered by the LEN method in T-SQL. Don't let this trick you and use
select max(datalength(Desc)) from table_name