I have a table under SQL Server 2005 with two columns (col1, col2) and this table have about 10 records, so the table look like this:
what's the best way to swap rows for cols to obtain some like this in a view:
val1 val2 ... valN
val_1 val_2 ... val_N,
where the values of COL1 becomes the column names of the result, and the values of COL2 the values for each new column.