• sunil88_pal88 (7/22/2015)


    Many thanks Luis

    You're welcome.

    Do you understand how it works? Please post any questions that you have about this.

    Here are some references:

    Unpivot using CROSS APPLY: http://www.sqlservercentral.com/articles/CROSS+APPLY+VALUES+UNPIVOT/91234/

    Cross tabs: http://www.sqlservercentral.com/articles/T-SQL/63681/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2