Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
AlanBourke
Frequent Visitor

Custom connector - restricting the databases and objects available.

I'm playing around with a custom connector based off the SqlOdbc sample. It will be connecting to MSSQL data.

 

For tidiness within Power BI Desktop, when the user elects to use this connector to get data, I would like:

 

  1. Only a subset of the databases on the server to be presented, probably based on a naming scheme, e.g. only list databases named like 'MyBusinessUnit1', 'MyBusinessUnit2' and so forth.
  2. One the user has selected a database, only certain views to be presented, again probably based on name. such as 'PBISales', 'PBICustomers' and so forth.

 

What I have done so far is on the MSSQL side. I have created a schema, only added the required views to the schema, then added a login tied to that schema, and made the connector use that login with username\password authentication.

 

Which is fine, except when in Power BI Desktop Get Data, all server databases are listed, but any that the SQL login doesn't have access to show an ODBC error under them.

 

I'm guessing that I could add an SQLTables function handler in the .pq file to somehow filter the list of tables returned but have no clue what the syntax there would be. Can anyone suggest anything?

0 REPLIES 0

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.