title: Retrieve the maximum length of a VARCHAR column in SQL Server
body: <p>I want to find the longest <code>VARCHAR</code> in a specific column of a SQL Server table.</p>
  
  <p>Here's an example:</p>
  
  <pre><code>ID = INT IDENTITY
  DESC = VARCHAR(5000)
  
  ID | Desc
  ---|-----
  1  | a
  2  | aaa
  3  | aa
  </code></pre>
  
  <p>What's the SQL to return 3? Since the longest value is 3 characters?</p>