title: Nulling varbinary without logging the full value
body: <p>If anyone has a suggestion for a better title, be my guest</p>
  
  <p>Background: I have an images table that stores photos from thousands of orders, but once those orders are complete/cancelled I want to remove the image (which is stored as a varbinary) without deleting the entire row, so that I don't exceed the 10GB SQL express limit</p>
  
  <p>The reason I don't want to delete the row is because I have another table with some images properties (crop area, brightness, etc) and if for whatever reason the image needs to be restored (simple API call to another server), it will just update the existing record in the images table, and I still have access to the properties for that image that are kept in the properties table</p>
  
  <p>So here's what a query could look like</p>
  
  <pre><code>UPDATE images
  SET images.image = NULL
  FROM images
  INNER JOIN orders on orders.order_id = images.order_id
  WHERE orders.status = 'COMPLETED'
  </code></pre>
  
  <p>And it takes forever, as it could be nulling up to a few GB of varbinary data a a time (orders are done in bulks, not one by one). That's all then kept in the transaction log. It can take my machine with a SSD up to a minute to complete that, and the production machine's HDD several minutes. </p>
  
  <p>Is there a way I can do a simple transaction log per query, rather than setting the entire log to simple mode? Or a better way of deleting the varbinary values?</p>
  
  <p>Thanks </p>