Data-driven report subscriptions on SQL Server 2005 Standard Edition to stop reports being sent with no data

Posted on 2009-02-13
Last Modified: 2012-05-06
It looks like Data-driven subscriptions are only available on Enterprise and Developer editions of SQL Server 2005. As a result, I don't know of a way of stopping reports that run from a view (so no parameters) to be emailed by subscription if there's no detail records in the resulting table (the view's execution result). There's a number of blogs out there showing how to send reports to mutliple parties that have different parameter settings for a report, but none to check on whether any results to be displayed before send.
Question by:Grffster
    LVL 11

    Expert Comment

    Hi.. unfortunately, you cant prevent a report from being sent without using a data-driven subscription and even with a data driven subscription, it will stil send an email even if there is no data but you get around by checking for data and if there is nothing then sending the email to a fake account else sending it to the proper recipients.

    There is nothing in the subscription functionality that will check the data being retrieved in the report.


    Author Comment

    Is what you're saying here only available in data-driven subscription then re: sending to a fake account? As a matter of interest, how do you do this please in data-driven subscriptions?
    LVL 11

    Accepted Solution


    part of the data-driven subscription involves writing some sql code that generates parameter values that are used in the report or the recipients emails for the subscription. You could use that sqL code to check if there is any data being returned by the query used in the actual report by including the code in a case statement and if null is returned then set the email as a dummy email address else set the email with the proper recipients


    Author Closing Comment

    Shame Microsoft haven't thought of a genuine solution to this as I'd imagine many people would require this functionality! Never mind...

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    How to increase the row limit in Jasper Server.
    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now