• PHXHoward (11/24/2015)


    Absolutely the query should be rewritten but it is TG week and the person is out of the office all week.

    It would be useful for me to learn something about working around an unchangeable query. ๐Ÿ™‚

    Thanks for the explanation.

    What proportion of rows have a non-empty value in the text column?

    "The text file is almost 2GB so I can't open it and modify the query 5.7 million times."

    What are you proposing to do with it? Have you tested to ensure it will work?

    Wouldn't it be more efficient to write one small batch to run against 5.7 million rows, exporting each non-empty text column value to file?

    โ€œ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