• There can be tons of reasons...

    Without seeing the code together with the actual execution plan of the code section in question for both cases (fast and slow) it'll be just guessing.

    My pot shot would be a locking/blocking condition or bad statistics.



    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]