Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

"OLE DB or ODBC Error" when connecting to Azure SQL with parameters for server/database



I need to connect Power BI to an Azure SQL database.  If I enter the server name and database directly into the "SQL Server database" dialog, it connects, prompts me for credentials, allows me to select tables, and subsequently imports data just fine.




However, if I enter the server and database name as parameters, and use the exact same server and db names as the "current value" of the parameters, I get the same table selection options, and can see data previews, as before, but when Power BI tries to import the data, I get the following error: "Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error: [Expression.Error] The import serverName matches no exports. Did you miss a module reference?" for every table I try to import.  serverName there is the name I gave to the server parameter.



Can anyone help?

Community Support
Community Support

Hi  @matt_b ,


From your description, your question is an error when connecting to a data source using parameters.
You can try changing the parameter type to any, which may solve the problem, I tested locally that I can connect to the database.






Best Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I get the exact same error when I used "Any" as the parameter type.  So, no, thank you, but that doesn't help.


If it had worked I would still have a problem, because I need to be able to update these parameter values via the Power BI Rest API when the report gets uploaded into Power BI Services - and that isn't possible with a parameter type of "Any".

Frequent Visitor

I meant to add a screenshot of how I'm entering the database details as parameters.  Here it is: 2022-12-09_09h43_07.png

Helpful resources

Exciting changes

Power BI Community Changes

Check out the changes to the Power BI Community announced at Build.

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Kudo Data Story carousel

Data Stories Gallery

Visit our Data Stories Gallery and give kudos to your favorite Data Stories.

Top Solution Authors