title: How do I get the "Next available number" from an SQL Server? (Not an Identity column)
body: <p>Technologies: SQL Server 2008</p>
  
  <p>So I've tried a few options that I've found on SO, but nothing really provided me with a definitive answer.</p>
  
  <p>I have a table with two columns, (Transaction ID, GroupID) where neither has unique values. For example:</p>
  
  <pre><code>TransID | GroupID
  -----------------
  23      | 4001
  99      | 4001
  63      | 4001
  123     | 4001   
  77      | 2113
  2645    | 2113
  123     | 2113
  99      | 2113   
  </code></pre>
  
  <p>Originally, the groupID was just chosen at random by the user, but now we're automating it. Thing is, we're keeping the existing DB without any changes to the existing data(too much work, for too little gain)</p>
  
  <p>Is there a way to query "GroupID" on table "GroupTransactions" for the next available value of GroupID > 2000?</p>