• ;with cte as

    (

    select val = 'XYZ', seq = 1

    union all

    select val = 'AAA', seq = 1

    union all

    select val = 'PQR', seq = 1

    )

    SELECT t.*

    FROM @T t

    join cte

    on t.Name = cte.val

    order by cte.seq

    If you put the string into a variable you could use the cte to parse it into a table.


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