Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 unpivot varying columns in excel spreadsheet

Author  Topic 

sarahmfr
Posting Yak Master

214 Posts

Posted - 2011-11-16 : 09:24:04
Hi All,
I have an excel spreadsheet
studentid, quiz1,test1,quiz3,etc..

111 10 20 10 etc.


I was able to unpivot it
but The column names will change i.e each class will have different quiz names and number how to automate the pivoting to depend on the coumnnumber instead of column header
i.e the other spreasheet might look as follows
studentid ,exam1, exam2,lab1, lab2,etcI

thanks in advance

sarah
   

- Advertisement -