• sudhirnune (4/9/2013)


    yes and might increase at any point of time.

    So to summarise, you want to take three or four very simple queries and convert them into a series of statements which are so complicated and convoluted that you need help to write them - at the expense of performance, maintainability and any other criteria which you may choose to distinguish a good query from a less well written one. Are you really sure you want to do this?

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden