title: SQL Server: update on single record only updated half the varchar content
body: <pre><code>update table1 
  set comments = @comments 
  where id = @id
  </code></pre>
  <p>In a web application, I had a single record update query for a <code>varchar(MAX)</code> column that only updated 40K characters of the 80K characters I was sending. So it chopped off the last 40K or so.</p>
  <p>I don't see how a column can part-update like that. Does it stream large values? ie. if the connection broke half way, and only half was transferred across? But surely it would wait for the full command and parameters to load in a buffer before executing?</p>
  <p>What if the table was busy with many users, and locks occurred and it was a victim of a deadlock? Once it started, I assume it would be all or nothing. But any possibility it could part-update the column?</p>
  <p><strong>Edit</strong>: it's definitely not in the database because the customer complained about the missing data, which I verified is in fact missing.</p>
  <p><strong>Edit</strong>: save would come via Javascript call to .NET web service to an EF save function. so could any of those truncate the data on a transmission/thread interruption type event?</p>
  <p>Note this is a one off event. But severely disrupting to the customer. So I really need to audit a cause. Many times this has worked fine over a long period of time. I am assuming it's some infrequent occurrence due to thread or internet interrupt somewhere on the pipe.</p>