Query in the sp never ends

  • Hello,

    I have a strange problem:

    If I run a query in the query window it takes 7 sec, but if I put the query in the stored procedure it never ends.

    When I'm executing the stored procedure (exec dbo.MyProc param1, param2, param3, param4, param5), in the profiler I can see:

    SP:CAcheMiss

    SP:CacheHit

    Degree of Paralelism

    Can anyone help me?

  • Sound like an out of data statistics and /or parameter sniffing.

    Use update statistics first off.

    Then Google for parameter sniffing.

    If that doesent sort it , please post as per the links in my sig



    Clear Sky SQL
    My Blog[/url]

  • Sorry, but it doesn't help me.

  • Then a lot more detail will be required to help.

    Please post as per the link in my sig



    Clear Sky SQL
    My Blog[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply