Skip to content

Instantly share code, notes, and snippets.

View savioserra's full-sized avatar
🏠
Remote Work

Sávio Serra savioserra

🏠
Remote Work
View GitHub Profile
@savioserra
savioserra / connect_and_load.py
Last active July 19, 2018 20:00 — forked from hunterowens/connect_and_load.py
Pandas and MSSQL
import pymssql
import pandas as pd
## Hey Look, college data
stmt = "SELECT * FROM AlumniMirror..someTable"
## instance a python db connection object- same form as psycopg2/python-mysql drivers also
with pymssql.connect(server="<server address>", user="<user>",password="<password>", port=63642) as conn: # You can lookup the port number inside SQL server.
# Excute Query here
df = pd.read_sql(stmt,conn)