Querying different database datasources depending on a variable in MS Sql

Azure Managed Grafana 10.2.1

Hi, have some problems with managing multiple databases with the same table structure. My databases structure has 1 database with overall information about customers with their unique IDs (around 200 rows).
Onward, every customer has his database with Transactions and Hardware Info which are related to ClientsInfo database by ID key.

My test dashboards have only 1 Client database, so I configured it as 1 SQL data source. But now I struggle with querying the database corresponding to ID of each client despite their databases having the same structure.
Can I change SQL data source which is querying depending on the ID of the client taken from ClientsInfoDb? Or the only solution is creating general Transactions and Hardware databases sacrificing the optimization?


Check this thread out

1 Like

I`ll check it as soon as possible, thanks a lot