I have a table that for each row, it has 5 columns for each sale rep that could be listed.
I need to insert each of the reps as a new row into a secondary table.
For example I would have:
Order Num, Rep1, Rep2, Rep3, Rep4, Rep5
and I want
Order Num, Rep1
Order Num, Rep2
Order Num, Rep3
Order Num, Rep4
Order Num, Rep5
I can do this with a cursor but I was wondering how to do this with just set based SQL.
I thought of doing 5 different inserts, one for each Rep but I'm wondering if there is a way to do it with just one.
Any thoughts?
Thanks All!