>You're looking to speed it up when it's a textbook case of how not to model a table?
>
I know it's a wrong structure of the table. I want to compare the speed of SQL 2012 solution vs. CROSS APPLY. The first UNPIVOT step can be changed to start from normalized table.
Anyway, I didn't have time yesterday to play with it although I had ideas of how to generate good test case. May be next weekend.
If it's not broken, fix it until it is.
My Blog