• Wouldn't it be easier to use PIVOT and UNPIVOT to transpose the columns?

    http://technet.microsoft.com/en-us/library/ms177410(v=sql.105).aspx