Forum Discussion
Replace Direct query table connection to a Direct query, QUERY connection - Databricks
- 1 year ago
Hi Anonymous ,
Please refer below complete sample M code. You can change the below code based on your code.
let
Source = Databricks.Multicloud.Catalogs("workspace_url", [Catalog=null, EnableAutomaticProxyDiscovery=null]),
Connection = Source{[Name="catalog_name"]}[Data],
Database = Connection{[Name="database_name",Kind="Database"]}[Data],
NativeQueryResult = Value.NativeQuery(Database, "
SELECT col1, col2
FROM table
WHERE col1 = 'value'
", null, [EnableFolding=true])in
NativeQueryResultNote: Change the "workspace_url" with your actual workspace url, "catalog_name" and "database_name" with your catalog_name and database_name, "null" parameter can hold query parameters.
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
- Anonymous1 year ago
Slight adjustment but this was my final connection string
Hi Anonymous
Why don't you try the native database query window while connecting to the data source ?
Please note that all complex queries might not work here but simple ones.
Reference: Import data from a database using native database query - Power Query | Microsoft Learn