Share via

SSRS Data Driven Subscription - Dynamic Query

Peter Bishop 256 Reputation points
2022-04-19T20:03:22.96+00:00

I have a number of SSRS reports which I run across numerous instances. The report uses a parameter to build the data source dynamically and that all works fine.

However... I run the report using a data-driven subscription which determines whether the report should run (or not) and the query which runs this has to use a fixed data source. Consequently I have 12 data-driven subscriptions for each report, one for each instance against which the report is being run.

Is there a way that I can have one data driven subscription per report which will connect to each instance, run the query that will determine if the report should run and if so, run the report? If this can't be done through the SSRS web interface I'm happy to go for T-SQL or SSIS solutions.

Thanks.

SQL Server Reporting Services
SQL Server Reporting Services

A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Joyzhao-MSFT 15,651 Reputation points
    2022-04-20T02:21:25.693+00:00

    Hi @Peter Bishop ,

    Is there a way that I can have one data driven subscription per report which will connect to each instance, run the query that will determine if the report should run and if so, run the report?

    This sounds unlikely to be achieved using Data Driven Subscription. Your description is not very clear to me.

    You could use data-driven subscriptions to do the following:

    • Distribute a report to a fluctuating list of subscribers.
    • Filter the report output using report parameter values that are retrieved at run time.
    • Vary report output formats and delivery options for each report delivery.

    If you want to get help from T-SQL and SSIS experts, please add such tags accordingly.

    Best Regards,
    Joy


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.