title: SSMS and SQLCMD displays only the first 8000 characters
body: <p>In SSMS when I try to execute:  </p>
  
  <pre><code>SELECT CONVERT(VARCHAR(MAX), REPLICATE('a',9000))    
  </code></pre>
  
  <p>I see only the first 8000 characters displayed. The settings <b>Tool >> Options >> Query Results >> Sql Server >> Results to Grid</b> is set to 65534 and <b>Results to Text </b>is set to 8192.</p>
  
  <p>Also when I try to run this from <b>SQLCMD</b>  </p>
  
  <pre><code>sqlcmd -S Server -E -y 0 -Q "SELECT CONVERT(VARCHAR(MAX), REPLICATE('a',9000))" -o out.txt
  </code></pre>
  
  <p>I see only 8000 charecters.</p>
  
  <p>The flag <b>-y 0</b> is supposed to set it up to 1 MB. But I do not more than 8000 characters.</p>
  
  <p>What could be the problem?</p>
  
  <p>thanks,<br>
  _UB</p>