title: LIMIT equivalent for SQL Server 2012 in an UPDATE statement
body: <p>I have the following table below and am trying to update the first available row with an user ID through a query, but I need to limit this to only update one row and not multiple.</p>
  
  <pre><code>ID     Model     UserID
  1      X12T5     1
  2      X13T5     2
  3      X14T5     NULL
  4      X15T5     NULL
  </code></pre>
  
  <p>The first available row would be where ID is 3. I would update it with the following query:</p>
  
  <pre><code>UPDATE Table SET UserID = '3' WHERE UserID IS NULL
  </code></pre>
  
  <p>But I want to make sure it affects only 1 row and not multiple that are available, LIMIT doesn't exist in SQL Server.</p>
  
  <p>What would the best way to achieve this?</p>