I am using sqlserver 2005. Table Details( sequence,person, Job) are available. if 'N' persons and 'M' Jobs are there how to generate sequence in matrix.for 2 persons and 2 jobs then in Details table data sequence should be for Sequence, Person, Job are 1 1 1, 1 1 2, 2 2 1, 2 2 2, 3 1 1, 3 2 2 , 4 1 2 , 4 2 1..
in Explination: sequence 1: first Person is alloted 1 and 2(for 1st Person 2 possible chances of allocating jobs only and 2nd Person have no jobs here).
Sequence 2: for 2nd Person 2 and 1 are allocated(for 1st person no possibilites of job and 2nd person has two chances of jobs).
Sequence 3: for 1st person first job and 2nd person second job.
Sequence 4: for 1st person second job and 2nd person first job. like wise.
Plz help how to generate this in sp if N and M are passed as Input parameters for NxM matrix. Thanks in Advance.