This repository provides a reference for connecting to a MSSQL database with Python/Pandas using Docker. Docker is used to avoid local dependencies on required MSSQL drivers.
- Rename
.env.example
to.env
and set the required environment variables. - Rename
query.sql.example
toquery.sql
and enter a valid query.
docker build -t python-mssql .
Run query/query.sql
.
PowerShell/Ubuntu:
docker run --env-file=.env -v ${PWD}:/script python-mssql run.py query/query.sql
Windows Command Line (cmd):
docker run --env-file=.env -v %cd%:/script python-mssql run.py query/query.sql