Technology: SQL Server 2008
So, I tried several options that I found on SO, but nothing gave me a definitive answer.
I have a table with two columns, (Transaction ID, GroupID), where there are no unique values. For instance:
TransID | GroupID
-----------------
23 | 4001
99 | 4001
63 | 4001
123 | 4001
77 | 2113
2645 | 2113
123 | 2113
99 | 2113
Initially, the groupID was randomly selected by the user, but now we will automate it. The fact is that we save the existing database without any changes in the existing data (too much work, for too little gain)
Is there a way to query "GroupID" in the "GroupTransactions" table for the next available GroupID> 2000?