• The simplest solution, if you are sure that the number of instances will always be three, is to use identity with a starting value of 1, 2, or 3, and an increment of 3. That generates ranges that will never overlap. (You can also pre-assign ranges like 1-100000, 100001-200000, etc - but those tend to run out)


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/