title: Why is maximum length of varchar less than 8,000 bytes?
body: <p>So I have a stored procedure in a SQLServer 2005 database, which retrieves data from a table, format the data as a string and put it into a varchar(max) output variable.</p>
  
  <p>However, I notice that although len(s) reports the string to be > 8,000, the actual string I receive (via SQLServer output window) is always truncated to &lt; 8,000 bytes. </p>
  
  <p>Does anybody know what the causes of this might be ? Many thanks.</p>