I work in an organization that has 50+ databases with identical schemas but data for different divisions and legal entities of the business. Some of the SSRS reports pull data from multiple databases into a single report however, the list of databases needed in a report can change several times a year requiring the Datasets in the reports to be rebuilt to target different databases,
This scenario creates a requirement to dynamically specify the databases needed for the query however, this is not something that SQL or SSRS provides direct support for and requires the use of Dynamic SQL to enable. As SQL is a Database engine, it's somewhat ironic that it does not have the native capability to dynamically specify the database a query should be run against and, that over the many versions of SQL, this capability has never been introduced into SQL or SSRS.
The functionality can be achieved by the use of Dynamic SQL but, Dynamic SQL has many complications associated with it and is not a great option when writing queries inside SSRS.
I have been posting this question on other forums but does anyone know of native ways this functionality can be achieved? Every solution I have found requires some kind of workaround or multi-step process to implement.
Thanks