• Maybe dynamic sql for the order by

    A cte with union all for each value might do it.


    Cursors never.
    DTS - only when needed and never to control.