SQL Server Stored Procedure Timing Out In SSRS Report Builder - sql-server

I have a stored procedure that I've tested over and over again in SQL Server Management Studio and it works fine, returning results in roughly 3 seconds; however, when I add the Stored Procedure as the Query Type for a new DataSet in Report Builder and attempt to, either run the report or execute the SP through the built-in Query Designer the execution call times-out. I haven't even used the dataset yet in any area within the report (Tablix's or Charts).
I've made sure that the Data Sources credentials are setup properly and even tested the connection to the DB and received a successful connection statement.
I have the Dataset Time out property set to 0 which should mean no timeout. Clearly, the timeout I'm receiving is being handled by the SQL Server rather than the Report Builder in this particular case.
What would make the Stored Procedure execute properly and efficiently (speed-wise) when executed from the server, but time-out when executed from Report Builder?
I'm running 2008 R2.
Please help! Thanks in advance.

Most time-out errors occur during query processing. If you are encountering time-out errors, try increasing the query time-out value. Make sure to adjust the report execution time-out value so that it is larger than the query time-out. The time period should be sufficient to complete both query and report processing.
Thanks
Venky

Related

Couldn't connect to database when using Top Resource Consumers QueryStore Report

We recently upgraded our SQL server to 2016 and I turned on QueryStore to do the analysis that it provides. I'm encountering a problem where, even if the time period of the report is Last hour, it will generate a message that says "Couldn't connect to database" even when running it on the database server itself. Sometimes if I keep refreshing the report it will eventually display some data, but it's intermittent at best. I'm running SSMS 17.5 on a sql server 2016 server.
We are having a somewhat similar issue with another program that connects to the database where it will sometimes not be able to connect, but every time I run my queries in SSMS, run reports in SSRS, or even use activity monitor, I never see any connection drops, so I'm not sure if it is related.
Thank you in advance for any help!
I find it works fine with the statistic set to Avg, StdDev, or Total. Max and Min give the error.
I found this happens when the query store runs out of space and gets into cleanup mode.
In database properties in SSMS try playing around with Query Store settings: for how many days it stores the query stats and does it get into "size cleanup" mode. More info on how to keep it adjusted: https://learn.microsoft.com/en-us/sql/relational-databases/performance/best-practice-with-the-query-store?view=sql-server-ver15#Configure

Query taking more time on local SSMS than remote

When I am executing a select statement with 4 'inner' joins and two 'WHERE' conditions it took 13-15 s in local SSMS (I have executed 5 times). But when I connect the same instance from another server's SSMS and execute the same query it took 5 s to execute first time and then it took 0 s! I am using the same user SA.
Is there any possible explanation for that?
Host instance is SQL 2008 and Remote instance has SQL 2008 R2.
If your query is returning data to display in your local SSMS then this data needs to be transferred from the server to your local SSMS. The time to transfer the data from the server to your local SSMS is included in the execution time. So, the execution time is a combination of executing the script and fetching the data in order to display it.
You might want to "Include Client Statistics" and then review the row "Bytes received from server" in the "Client Statistic" tab of the result window.
In order to verify my assumption you can alter your select only to execute without fetching the data.

how to debug when sql server timesout using a stored procedure at a certain time of day

I am using asp.net (version 4) and am trying to run a stored procedure which I have created
ALTER PROCEDURE [dbo].[some_proc]
AS
BEGIN
INSERT INTO [dbo].[some_proc](Creation_Date)
VALUES (getDate());
select SCOPE_IDENTITY();
END
The procedure runs fine when called from within server management studio (runs in less than a second) and also runs fine from my web app UNTIL the afternoon (about 3pm), at which point I get a timeout error, as below:
The request channel timed out while waiting for a reply after 00:00:29.9969982. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.
Other stored procedures that I try and run and return expected results. All the stored procedures query the same database.
I have reviewed several other answers on similar questions but they haven't helped me regarding this situation.
I realise this issue may be very specific to my situation, and if it is then my question would be how do I start to debug this issue (any tools or techniques would be really helpful)
You could run a SQL Server Profiler session recording database activity between 2.30 and 3.30
also check SQL Server Agent for any jobs that start around that time

SSRS Stored Procedure (Timing Out?). Using too many Linked Servers?

We are using one shared data source ds1 that connects to a server main_server which holds all the stored procedures to generate our reports.
One of the stored procedures usp1 simply executes another stored procedure on another server another_server:
exec another_server.another_database.dbo.usp1
When I execute usp1 on main_server, everything works fine. It runs at almost the same speed as if I had just gone to another_server and executed from there.... Which is what I expected...
However, when I try to run the report from our report server, it fails. When I watch it run, it almost immediately goes into suspended mode and stays there.
We have all of our timeouts set to 40 minutes, so that shouldn't be our issue, since the report runs in 15. Any thoughts?
Thanks...
Maybe the account reporting services uses to run the report doesnt have the correct access or rights to run an sp on another server?
With linked servers your stored procedure may copy ALL the data it needs before doing any joins.
Check out:
http://blogs.msdn.com/b/dataaccesstechnologies/archive/2010/06/30/linked-server-performance-heterogeneous-databases.aspx

Crystal Reports and stored procedures with parameters

I work with Crystal Report 2008 sp2, and during creation of a new report template I've encountered a problem. I created a stored procedure, which prepares and pivots needed data on the server side, and filters it using a parameter.
When I try to add this stored procedure to the report template in Crystal Editor, I receive SQL error 102 - incorrect syntax near ')'. Although I can easily add user defined function to my report with exactly the same parameter.
What could be the source of the problem?
P.S. Stored procedure does run and return correct data if I run it in the SSMS.
As long as you are returning a record set from the store procedure try using a command object
in the command object:
EXEC mystoredProc ({?variable1}, {?variable2})
The "exec mystoredProc()" was a good try, but didn't work for me.
Crystal to/from Oracle 10g SPs is kicking MY butt... I've worked every example from BOXI/SAP, a couple from the web, and from "Crystal Reports 9 on Oracle", and all I get are Crystal's/Oracle's error messages.
The latest is "Object Specified is incompatible with the flag specified." ORA-04047, with an ORA-20004 and an Ora-06512 thrown in for good measure.
I'm trying to get the simplest SP return for a beginning... Just give me the Select * results from a table.
Any hints?
I've tried the Oracle native (client) drivers, The Oracle ODBC drivers... I haven't gotten the Crystal Oracle drivers to work, tho'.
Depending upon the driver I'm using, I can get PLS-00302 - Component must be declared.
I've written and re-written these things over and over. Right now, I'm not a happy Oracle camper. MS SQL was sooo much easier.

Resources