Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/turnipdo/ssms-sql-powerquerym-functions
Using Power Query M to extract values from Excel workbooks for dynamic insertion into SQL code.
https://github.com/turnipdo/ssms-sql-powerquerym-functions
data-analytics microsoft-excel powerquerym sql
Last synced: 18 days ago
JSON representation
Using Power Query M to extract values from Excel workbooks for dynamic insertion into SQL code.
- Host: GitHub
- URL: https://github.com/turnipdo/ssms-sql-powerquerym-functions
- Owner: Turnipdo
- Created: 2024-06-03T03:51:17.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-10T08:06:24.000Z (7 months ago)
- Last Synced: 2024-11-06T01:50:18.947Z (2 months ago)
- Topics: data-analytics, microsoft-excel, powerquerym, sql
- Homepage:
- Size: 13.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SSMS-SQL-PowerQueryM-Functions :atom:
Using Power Query M to extract values from Excel workbooks for dynamic insertion into SQL code.## Requirements :basecamp:
* `SSMS`
* `ODBC Driver For SQL Server`
* `Microsoft Excel`## Instructions :page_with_curl:
* Ensure you have all the requirements and everything is configured properly (especially SSMS and the ODBC Driver).
* Open an Excel Workbook.
* Name you're first sheet as Parameters (this is where we will be extracting the text value from).
* Paste your SSMS server name wherever you'd like (ideally on the top left corner).
* Have another cell ready below the server name for continents, and name the cells 'Server' and 'Continent', respectively.
* Now go to the `Data Tab` :arrow_right: `Get Data` :arrow_right: `From Other Sources` :arrow_right: `Blank Query` :arrow_right: `Advanced Editor`.
* Once you're in the Advanced Editor you will need to first input the fnGetParam Power Query M script I've attached, this code basically extracts the value from the named cells (make sure the it is named fnGetParam or else the function call will not work).
* Create another blank query either by right-clicking in the [Queries] section and selecting New Query.
* Paste the SQL code I've attached and change all the necessary customizable named components such as the ODBC Driver you're using and the database you're extracting from.
* Voila, you can now close and load, and if it asks you for authentication, I usually select `Windows` :arrow_right: `Use Current Credentials`.## Video Sample :film_strip:
[Watch the video](https://github.com/Turnipdo/SSMS-SQL-PowerQueryM-Functions/blob/main/fnGetParam.mp4)