Question : Report failure notification in SQL REPORTING

How can i send a report failure notification through email ? The situation is, i scheduled a report, i dont want to send email when the report run successfully, but i want to send an email if its didnt execute or if it fails coz of any reason. Is there any solution for this ?

Answer : Report failure notification in SQL REPORTING

rrjegan17: I believe it could be interesting for a DBA/Developer to get notified when a (scheduled) report has not been rendered with success, hence the asker's question.

jlaxmi: I assume that you are asking this question in relation with scheduled reports?

When creating a report subscription, what is actually happening in the background is that SSRS creates a job for the SQL Server Agent.  This job gets a cryptic GUID as its name, but looking at the schedule you should be able to find it through the Management Studio.
This job only has one step, which is "render the report".  What you could do is add an extra step to that job to call a stored procedure.  This stored procedure could check the dbo.ExecutionLog table in the ReportServer database.  To be able to do this you will need to figure out the ReportID of your report.  This can be done by querying the dbo.Catalog table in that same database.  The ItemID in Catalog can be joined with the ReportID in ExecutionLog.
Furthermore you'll need to test the Status field in ExecutionLog for values other than "rsSuccess", within the expected time frame (use the TimeStart column).  And then use sp_send_dbmail to send out that email when needed (Database Mail needs to be configured for this to work).

IMPORTANT: Keep in mind that this job looses its manual changes whenever you modify it through the Report Manager.
Random Solutions  
 
programming4us programming4us