Forum Discussion
One or more tables reference a dynamic data source.
1. why are you using an ODBC connection rather than the default Sql.Database() connector?
2. Have a fixed connection string, for example to the 2023 database. Then in your custom queries specify a different database as needed.
- LuiSMSR2 years agoNew Member
Hello lbendlin, thank you for your response.
Why do you think I'm using ODBC connection? In my formula I have Sql.Database connector, and my data is brought by a SQL server.
I did not understand 2. Do you mean I create a parameter with value "CTA2023" and in my query i change it as needed? What I want is to have CTA+year we're at without going to the query and change it myself.
- lbendlin2 years agoSuper User
You use a connection string, That is not necessary, it is sufficient to specify the server name.
Sql.Database - PowerQuery M | Microsoft Learn
My suggestion is to create a connection against database A but then in your native queries you can reference database B on the same server assuming you have permissions to both databases.