Finding the longest entries for a given column (nvarchar(100)) I am trying to find the biggest / longest entries of a column which is of type nvarchar(100). I need to understand if I can maybe restrict that column to be only nvarchar(20) or something. Is there a way to do so? I know that I can't change the type to nvarchar(20) if I have any longer entries.
You can achieve this with this code snippet:

SELECT TOP 1 LEN(column), column
FROM yourTable
ORDER BY LEN(column) DESC


Just replace column with your column which holds the nvarchar(100)