Add 'Open in Excel with Data Connection' (via Power Query)
Summary
Currently, the "Open in Excel" feature is highly utilized for ad-hoc analysis, but it creates a strictly static snapshot of the query results. I am proposing an additional context menu option to create a live data connection.
Proposed Context Menu Name: Open in Excel (Power Query) or Open in Excel (Data Connection).
Rather than just dumping the output into excel, this feature would generate an Excel workbook with an embedded, refreshable Power Query (Get & Transform) connection linked back to the source database using the exact query executed in the window. This gives users who regularly use "Open in Excel" a way to not only see the data, but also see the query that generated the data. Which would also seamlessly transition into automated, refreshable reporting in both Excel and Power BI.
Key Benefits:
-See the query that generated the data
-Data is refreshable
-Streamlines Power BI migration
Technical Implementation Note:
Generating this file is highly straightforward. The Redgate tool simply needs to pass the SSMS connection string and the query text into standard Power Query M-code within the generated .xlsx file:
let
Source = Sql.Database("ActiveSSMSServerName", "ActiveSSMS_Database", [Query="<SQL Query used to generate the data>"])
in
Source