I have 2 tables: Master and Lookup. The Lookup table has Segment, Cell and Quantity. Need to update Master table using data from Lookup table. Ex: Select needed quantity in Lookup table of 100,000 records for Segment = B and pass to Master table update statement to set Cell = 1 for top 100,000 records where priority_flag = 1, then 2, then 3 until 100,000 quantity is met. Once this is complete, I would then go to next line in Lookup table perform same process until I reach the end of each row in Lookup table. This way I don't have to run 19 update statements manually. Thanks!