Skip to content

Instantly share code, notes, and snippets.

@ymdx
Created July 12, 2017 06:30
Show Gist options
  • Save ymdx/17be235c6b7d8654d9c4cfc740ab544e to your computer and use it in GitHub Desktop.
Save ymdx/17be235c6b7d8654d9c4cfc740ab544e to your computer and use it in GitHub Desktop.
Create Database on Python with pymssql PATH
import pymssql
def createDB(PATH):
conn = pymssql.connect(server="server", port="port", user="user", password="pass")
conn.autocommit(True)
cur = conn.cursor()
cur.execute('CREATE DATABASE '+PATH)
conn.autocommit(False)
conn.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment