Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/turnipdo/pyodbc-data-import-for-ssms-alextheanalyst-ref-
Using Python's pyodbc module to connect to Microsoft SQL Server and import data into SSMS.
https://github.com/turnipdo/pyodbc-data-import-for-ssms-alextheanalyst-ref-
data-engineering pyodbc sql ssms
Last synced: 25 days ago
JSON representation
Using Python's pyodbc module to connect to Microsoft SQL Server and import data into SSMS.
- Host: GitHub
- URL: https://github.com/turnipdo/pyodbc-data-import-for-ssms-alextheanalyst-ref-
- Owner: Turnipdo
- Created: 2024-05-21T03:50:23.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-06-10T07:52:45.000Z (7 months ago)
- Last Synced: 2024-11-06T01:50:21.698Z (2 months ago)
- Topics: data-engineering, pyodbc, sql, ssms
- Language: Jupyter Notebook
- Homepage: https://github.com/Turnipdo/Portfolio
- Size: 3.76 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PyODBC Data Import Into SSMS :atom:
Using Python's pyodbc module to connect to Microsoft SQL Server and import data into SSMS.## Additional info :warning:
This mini project offers an alternative method to importing data into SSMS compared to the process shown in "Alex The Analyst's" Data Analyst Portfolio Project | SQL Data Exploration | Project 1/4 video.
[Link to his video](https://www.youtube.com/watch?v=qfyynHBFOsM)* Initially, I was unable to import the data into SSMS directly from Excel as a data source.
* Instead, I utilized the pyodbc package in Python to create my tables, which allowed me to insert my data afterward.
* You'll notice that I had to use the `fillna()` function in order to convert them to an acceptable `NULL` value for SSMS.
* The benefit of doing this is that it avoids the need for us to use a `CAST()` or any type of `CONVERT()` to an int datatype because the tables created initially are of float datatypes.
***Note***: *While I fully agree that I could have simply imported a flat file source in SSMS, I opted to explore something different, hence my use of pyodbc as an alternative.* :trollface:
## Requirements :basecamp:
* `SQL Server`
* `SSMS`
* `ODBC Driver For SQL Server`
* `VSCode`
* `PyODBC module`
* `pandas`
* `numpy`## Instructions :page_with_curl:
* Configure SQL Server and ensure you have an ODBC Driver setup already.
* pip install the `pyodbc`, `pandas`, `numpy` module in VSCode's terminal.
* Use the code.