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
Use the built-in functions for length and max on the description column:
SELECT MAX(LEN(DESC)) FROM table_name;
Note that if your table is very large, there can be performance issues.