Home Forums SQL Server 2008 T-SQL (SS2K8) Select statement of view stays 5 hours to return results...... RE: Select statement of view stays 5 hours to return results......

  • JMSM (1/9/2011)


    Thanks a lot LutzM.

    I'll change the function as u tell me.

    Regards,

    JMSM 😉

    The function issue is not the only problem (might not even be the most relevant one).

    So, please follow Grants advice and post the actual execution plan.

    And don't worry too much about Celko's post... If you'd take the time trying to read and understand what his real intention is, you'd probably have rewritten your code by then anyway... 😉

    Beside he really knows SQL stuff (at least what rumour tells) he's got that "special" online personality. The bottom line: He doesn't like the way you name your columns, tables, and views. Doesn't change performance at all, but would help readability and maintainability, I admitt. But that's not the major concern here, I guess.... 😉

    He's right about the DISTINCT issue though...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]