SQL: How to distribute records to employees based on their highest capacity available?
Hi, As per our requirement, I should assign records to employees based on their capacity and category and other attributes. As per the earlier post, i was able to assign records evenly. But I need to look at the employee capacity also. For example, if an employee has 30 capacity, he can get assigned more records than the person with lowest capacity. If that employee reaches 0 capacity, i should take him of the list and start assigning. I tried a cursor for row by row processing and round robin as well. But i am not getting desired output. Please advise.