• richardmgreen1 (7/29/2014)


    Thanks Luis

    Firstly, that's a lot shorter than my code and (I assume) will run a lot quicker.

    Just a couple of questions, I've googled cross apply several times but I always get lost somewhere along the lines. Can you explain how it works in idiot-proof terms please?

    With the cross apply and cross-tab approach, does this mean the data will be read one instead of (in this case) 14 times?

    This series of articles should help you with Cross apply.

    http://www.sqlservercentral.com/articles/APPLY/69953/

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events