Here is an idea: - Create a new table PickOrder with 2 columns - division and chosenName. - Iniitialize PickOrder with 4 records - ('North', 'a1') ('South', 'a1') ('East', 'a1') ('West, 'a1') Now, in sp_GetAssignedDetails, 1- Get the chosenName value (cn) from the PickOrder table for the requested division. 2- Using your query, select the top 1 record WHERE actorName > cn ... ORDER BY actorName 3- if no record is found in step 2 and there are existing records for that division (i.e., we have exhuasted the list), set the chosenName to 'a1' and repeat step 2 to start with the first name. 4- Update the chosenName column value in PickOrder table with the actorName found in step 2, so that next time we can pick the next name. -- modified (added ORDER BY clause) at 22:08 Thursday 2nd November, 2006
-- Damodar Periwal Software Tree, Inc. Simplify Data Integration