SHARE
TWEET

Untitled

a guest Dec 10th, 2019 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import urllib
  2. import pyodbc
  3.  
  4. params = urllib.quote_plus("DRIVER={ODBC Driver 17 for SQL Server};SERVER=yourserver;DATABASE=yourdatabase ;UID=user;PWD=password")
  5. cnxn = sqlalchemy.create_engine("mssql+pyodbc:///?odbc_connect=%s" % params)
  6.  
  7. df.to_sql("table_name", cnxn,if_exists='replace')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top