• Luis Cazares (8/2/2012)


    Would a SELECT of the original tables using just the required columns help? or it wouldn't make any significant improvement?

    Or maybe a view limiting the rows I need before I use the query on my SP?

    Whenever possible you should only select columns of data that you actually need. It is hard to tell what this all doing without spending a bit of time digging. If I get some time I will dig deeper and see if I can find anything that might help.

    Why the NOLOCK hints everywhere? This looks like some sort of claim system, just the type of system where dirty reads would be considered a bad idea.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/