Generate salesman and job combinations

Oct 15, 2009 at 7:44 AM

Hi, I am working on sql server 2005.

Basic story: When a customer call to a call center and say he has a problem in assembling the computer and so required a Technician to fix the problem.
The call center guy fix a job taking details of customer like Customer name, address, Zip code, Region and If he require a Skill Tech, Certified Tech, any particular date and time to repair

So need to check who all the available technicians who are exactly suit to customer requirement..

so the call center guy will get a list of technicians who are available close in distance to the customer location
and the tech timings has to be available to fix that problem means he should be free at that customer chosen time or has schedule to any another customer. If so another tech has to be schedule for this job.

And so the Tech will be scheduled and appointment will be fixed.

Let us Suppose another job has come
which is more near to that customer, then we need to reschedule the tech to this job if all the requirement is ok, and more near to this new job
with same skills, certificate requirement of tech has to be allocated to the previous job.. which means we are rescheduling jobs when and every new job will arrive..

so all time all the techs has to be checked if they need to reschedule.
distance should be calculated based on latitude and longitude, distance should be between customer(job) and Tech.
how the sequence generation should be followd. pls trow light and could suggest me a better idea for approach it would be more helpful.<!-- / message -->

Bottom line of my Problem:
Compare all possible sequences to which we can assign job to Technicians available.
this should be done in sql server as per requirement. pls help.