Skip to content

Execute a query on a MSSQL database using Docker, Python and Pandas

Notifications You must be signed in to change notification settings

tcrapts/docker-python-mssql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-python-mssql

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.

Usage

Prepare query and credentials

  • Rename .env.example to .env and set the required environment variables.
  • Rename query.sql.example to query.sql and enter a valid query.

Build image

docker build -t python-mssql .

Run image

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

About

Execute a query on a MSSQL database using Docker, Python and Pandas

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published