I have a table like this
Table1
Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8
1 2 3 4 5 6 7 8
2 2 3 4 5 16 17 18
3 2 3 4 5 26 27 28
4 2 3 4 5 36 37 38
I want the data to be converted in this format
Col1 DerivedCol1 DerivedCol2
1 Col6 6
1 Col7 7
1 Col8 8
2 Col6 16
2 Col7 17
2 Col8 18
3 Col6 26
3 Col7 27
3 Col8 28
4 Col6 36
4 Col7 37
4 Col8 38
Edit: One more important aspect in the question is that i dont know how many columns that i am going to choose to make them as Name, Value pairs and that might change at run time.