I currently have a table that looks similar to this:
I need to import the data to a new table, but making the column headers into rows and value for each one. Similar to this.
Would I use a Pivot or an Unpivot to do this? I have a lot of columns with about 700 rows that need to be converted this way.
You should go with unpivot
, try the query below. Generally speaking, Pivot
reduces the total number of rows while Unpivot
increases it, instead.
select SN,Property,Value
from tbl
unpivot
(Value for Property in (Property1,Property2,Property3,Property4) ) as tblunpvt