title: Query to update row value in next blank column
body: <p>I have a table called <code>StencilStorage</code> and it has fields that look like this.</p>
  <p><a href="https://i.stack.imgur.com/h4MG4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h4MG4.png" alt="enter image description here" /></a></p>
  <p>What I am trying to accomplish is creating a stored procedure that will update the table and set <code>PCB_ID</code> equal to some irrelevant number wherever the next available slot is, sorting the table from low-&gt;high by <code>UNIQID</code>. I have the following so far. The next available slot is labeled as <code>0</code> as shown in row 5 in the table above.</p>
  <pre><code>CREATE PROCEDURE sp_insert_to_storage
  (
      @PCB_ID integer
  )
  AS
  BEGIN
      UPDATE Tooling.StencilStorage
      SET PCB_ID = @PCB_ID 
      WHERE
  GO;
  </code></pre>
  <p>Any help is very much appreciated.</p>