Created
July 12, 2017 06:30
-
-
Save ymdx/17be235c6b7d8654d9c4cfc740ab544e to your computer and use it in GitHub Desktop.
Create Database on Python with pymssql PATH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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