Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to avoid Stored Proc ?

Posted on 2012-03-12
7
Medium Priority
?
329 Views
Last Modified: 2012-04-05
Hi Gicks,

Here I have one scenerio.

There is one Stored Proc which contains 5000 LOC. During Execution of this Stored Proc, MDX query is generated dynamically. Based on this MDX query, SSRS report was built. It takes long time to display report.

- Is there any alternate way to avoid this Performance Issue. ?  
- Is there any alternate method to avoid this Stored Proc.

Regards
Raveen
0
Comment
Question by:Ravee123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 15

Expert Comment

by:Tim Humphries
ID: 37713556
Hi,

I suspect that if the report takes a long time to run the problem is with the MDX or the cube structure rather than the time taken by the procedure to build the query.

Can you post the MDX generated? Presumably this varies depending on input parameters - a few examples of output from the procedure would be useful.

Thanks

Tim
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 37713565
>>Based on this MDX query, SSRS report was built. It takes long time to display report.

If the data for the report doesn't change (or only changes occasionally) then you could store the results into a temporary table and base the report on that table instead of generating the data each time you display the report.
0
 
LVL 40

Expert Comment

by:lcohan
ID: 37714749
What SQL Server version(s)/edition(s) are you using and what service pack levels?
Also, did you tried to manualy excute the stored proc against your SQL server to separate the backend from the front end report? If the stored proc takes long you need to optimize your code and/or add indexes but if the SP execution is reasonable then you need to optimize your SSRS environment(hardware/network/client?)
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 37715452
OMG  No stored procedure should have 5,000 lines of code.  I agree with previous comments that you should consider splitting it up and then optimize each step.
0
 
LVL 25

Expert Comment

by:jogos
ID: 37715995
When having 5000 lines of code my guess it contains a lot of 'the same' but duplicated because of one or two things differ between handling type A, type B .... K .
0
 

Author Comment

by:Ravee123
ID: 37720185
Not Duplicated. It has different scenerios.

Hi,

I suspect that if the report takes a long time to run the problem is with the MDX or the cube structure rather than the time taken by the procedure to build the query.

Can you post the MDX generated? Presumably this varies depending on input parameters - a few examples of output from the procedure would be useful.

Thanks

Tim

Unable to post that SP and MDX is generated within this SP.
0
 
LVL 15

Accepted Solution

by:
Tim Humphries earned 1500 total points
ID: 37720268
Hi,

But you can presumably run the sp in isolation and post the MDX that results from it in different scenarios. That may enable the MDX query to be better understood - as well as what the sp is doing and why the solution was implemented in this way in the first place.

If you can't run  the sp in isolation, you can use Profiler to capture the MDX being executed when the report runs.

Thanks

Tim
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question