January 22, 2009 at 3:42 am
Basically it is a very common interview question. Its like this:
My SSRS report works on some Sp's. Its working fine until last night. But today morning onwards, its not working, not showing any data. Previously it took 3 mins to execute, now it is taking hours and not showing any data.
The SP is also taking hours to execute and not showing any data.
What might happen and what is the work around?
January 22, 2009 at 3:49 am
Check connections from studio and the reporting server, if there is a problem with SP, they try running on SQL and check the time, there must be any index missing, it must be a small thing to spot out 🙂
January 22, 2009 at 3:55 am
Hi,
Thanks for your reply.
It is working yesterday night fine. Meanwhile there is not such bulk insertion etc. So index should not be a factor.
Also other reports are working fine. It happens with only this report. So conenction etc. is ok.
The problem is happening in the SP also. This SP was running good last night. Today its not able to execute, taking hours of time.
Any suggestion?
January 22, 2009 at 4:42 am
so this is a problem with SP which suddenly behaves badly:), can you post the SP, we can check on the code 🙂
January 22, 2009 at 6:15 am
Hi,
I have told in my first post, this is an ineterview question. I need to know what may happen and what may be the work around.
what I think, it may be realted to locking, but all of a sudden it happend.
This is the scenario.
thanks,
Arup
January 22, 2009 at 11:46 am
Run profiler and check for events like SP:starting ,SP:Recompile,SP:stmtcompleted and SQL:Batchstarting while running this report.
Not to mention the code for this SP can also be checked by viewing the execution plan for any missing statistics..
Thanks!!
The_SQL_DBA
MCTS
"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
January 23, 2009 at 12:45 am
Hi The _SQL_DBA,
its not a problem i have faced. I need 2 know what may happen for this problem and the possible work around 4 that. Is locking may cause this kind of problems?
Plz remember, the report/SP was working fine until last night. From today morning, this is happening.
January 23, 2009 at 8:34 am
I would check the actual data added between the time the report/stored procedure was working and when it quit working. I have seen several cases where reports or stored procedures have failed because the new data was entered in a different format, or contained characters that the writer of the report or stored procedure did not expect.
January 23, 2009 at 9:26 am
are you outputing your data into table region in your report? well, it has a property 'no rows' and defaults to 'No Rows matching your criteria'. if your stored proc runs well directly from sql, but in report this message is printed, you may want to look at other things.
January 23, 2009 at 1:31 pm
Well, it being an interview question you have to answer this in a stipulated amount of time, the answer could be as:
1. If report is not working then run profiler and check the events I mentioned before
2. If the stored procedure is taking too long then check the events 'textdata' and 'blocked process'. Not to mention, take a look at the execution plan.
Ideally this looks like a severe blocking issue to me as nothing has changed from last night.
Look to see if either SP or the CULPRIT SPID have any NOLOCK hints or no...having said that this is just a few steps in the right direction to find out the solution.
We can do better than this in real scenario, for an interview this answer should be more than sufficient..;)
Thanks!!
The_SQL_DBA
MCTS
"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
January 23, 2009 at 1:34 pm
nitin.saha (1/23/2009)
I had a similar problem in SQL 2005. The issue turned up to be that my id lost execute authority on the SP. I had to re-grant the execute authority & it then worked fine.
If the ID lost execute permission then this is not at all an issue as you would see an error message at the report execution.
But then it would be a pain to find out how did the ID lost the execute permission all of a sudden..time to work harder on your security....:D
Thanks!!
The_SQL_DBA
MCTS
"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
January 27, 2009 at 2:59 am
Hi All,
Really this is a great help for me. I have faced this question several times.
Thanks again.
January 28, 2009 at 4:41 am
When you exec your SP use [WITH RECOMPILE] option - it forces a new plan to compiled. Old plans remains in cache and if some indexes etc changes or drops that old plan might turn really slow.
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply