December 31, 2009 at 12:54 am
I have a data driven subscription set up which works fine and sends an email which includes an Excel rendering of a report that's based on the contents of a table that's populated daily. If there are no rows in the table, I would like for the email to not be sent to the users.
Is there any way to do this?
January 4, 2010 at 6:26 am
In my experience this is one of the drawbacks of the data-driven subscription as there is no way to specify that if the report has no rows don't send the email. Someone may have a work around for this though. For regular subscriptions I have done a separate job that checks for data, then calls sp_start_job to execute the job that runs the report. I don't know if that would work with a data-driven subscription though.
There have been other threads here on SSC where other people have suggested work arounds for subscriptions, but I don't recall if they included data-driven subscriptions.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
January 7, 2010 at 8:43 am
Actually, if you set up the query in your subscription to return the email addresses you want to send out to, and set it up so it returns nothing when you have no data, then it will not send the email. In your To: field, select "speficy a value from database" and use the results of that query.
October 22, 2014 at 12:46 pm
Actually, if you set up the query in your subscription to return the email addresses you want to send out to, and set it up so it returns nothing when you have no data, then it will not send the email. In your To: field, select "speficy a value from database" and use the results of that query.
From what I can tell, your idea results in an empty report that IS sent in an email.
If I'm wrong, please detail how you avoid getting an empty report using only the DDS.
Thanks,
Keith
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply