Stored Procedure Getting Executed many times..

  • Hi ,

    I have a stored procedure that is used to populate a report. When the stored proceudre is executed from Query Analyzer, it gets done in about a min. Where as, when the same procedure is executed from crystal reports it takes about 30 - 35 mins to finish. The trace shows that the procedure is getting executed for more than 50 times.  By the way, there is another nested stored procedure which gets called also.

     

    Can anybody help me with this strange behaviour..?

    Thanks

     

  • Seems to me like the problem comes from the reporting side of the process. Can you go into debug mode to see why it's being called so often?

  • You don't have that stored procedure being called for every single detail line do you?  That would definitely cause issues.

    Derrick Leggett
    Mean Old DBA
    When life gives you a lemon, fire the DBA.

  • Are you using Sub Reports by any chance. If yes then where have you placed it. If stored procedure is called 50 times, and its attached to SubReport, is subreport shown 50 times. I wish to know is it Subreport which is calling stored procedure.


    Madhav

  • "By the way, there is another nested stored procedure which gets called also."

     

    Sounds to me you are tracing the SP:Starting or SP:Completion event. In this case, all nested SP calls will be captured by the profiler. If this is the case, you can try to trace RPC:Starting and RPC:Completion. 

     

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

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