createCursor.py
import pymssql
import logging
def createCursor(serverAddress, userName, password, dataBase):
# create connection and cursor
conn = pymssql.connect(serverAddress, userName, password, dataBase, charset = "UTF-8")
logging.info("sqlServer connection Successfully Created. ")
cursor = conn.cursor()
logging.info("cursor Successfully Created. ")
return conn, cursor