I am facing a weird problem and I would be glad if anyone can help me.
In our company we use SSRS to send daily Reports to the Same Management.
We Have 3 Types of Reports, which of 3 is executed more times with different parameters. The first it is executed 2 times, the second 3 times and the third, which is the heavier and is falling 6 times.
All the 3 queries have the same philosophy using CTE tables. The queries developed in SSMS and added to the Report via Visual Studio.
And here starts the madness.
In the first edition we have them at the same schedule. Two of them are executed with no error and the emails were delivered.
The third report is falling with error
Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for dataset 'ZZZ'. ---> System.Data.SqlClient.SqlException: Invalid object name 'tempdb.dbo.TEMP_ID_XXXX'.
When we disable the other 2 reports and executed the 3rd manually the report completed successfully.
But this only some days, some other days all the reports delivered successfully.
Then we decided to split the schedule of these 3 reports. So, we create 2 job steps. One for the first two and one for the third report.
The first two days the reports delivered as we want, but from yesterday we are facing the same issue.
As I saw the job steps have a time difference some milliseconds although the reports of the first step are taking around 15 seconds to complete.
I checked the Execution log and saw that for the one parameter version Execution of the third report it takes:
12990ms when it is executed manually through the portal.
23845ms when it is executed as a job (Parallel with the other 5 parameters execution)
35761ms when it is executed parallel with all the other reports (11 in total) Failed
I thought that maybe if adding and extra step between the 2 reports step that will pause job for 1 minute will fix my problem.
Has anyone facing any similar issue?
Any help would be appreciated!