When I run a SQL query which returns one column with variable number of rows returned, I'd like to transform each of the row into column VALUE (I don't mind what the column header/titles are).
E.g.
Column1
-------
a
b
c
d
e
I want a script which will transform the above into a table like:
Col1 Col2 Col3 Col4 Col5
------------------------
a b c d e
(Note that I do not care for the column names).
I know I cannot user PIVOT as row numbers are not fixed (they are based on a SQL query).
Any ideas?
Thanks!