title: Python sqlalchemy trying to write pandas dataframe to SQL Server using .to_sql
body: <p>I have a python code through which I am getting a pandas dataframe "df". I am trying to write this dataframe to Microsoft SQL server. I am trying to connect through the following code by I am getting an error</p>
  
  <pre><code>import pyodbc
  from sqlalchemy import create_engine
  
  engine = create_engine('mssql+pyodbc:///?odbc_connect=DRIVER={SQL Server};SERVER=bidept;DATABASE=BIDB;UID=sdcc\neils;PWD=neil!pass')
  engine.connect()
  df.to_sql(name='[BIDB].[dbo].[Test]',con=engine, if_exists='append')
  </code></pre>
  
  <p>However at the engine.connect() line I am getting the following error</p>
  
  <pre><code>sqlalchemy.exc.DBAPIError: (pyodbc.Error) ('08001', '[08001] [Microsoft][ODBC SQL Server Driver]Neither DSN nor SERVER keyword supplied (0) (SQLDriverConnect)')
  </code></pre>
  
  <p>Can anyone tell me what I am missing. I am using Microsoft SQL Server Management Studio - 14.0.17177.0</p>
  
  <p>I connect to the SQL server through the following </p>
  
  <pre><code>Server type: Database Engine
  Server name: bidept
  Authentication: Windows Authentication
  
  for which I log into my windows using username : sdcc\neils
  and password : neil!pass
  </code></pre>
  
  <p>I am new to databases and python. Kindly let me know if you need any additional details. Any help will be greatly appreciated. Thank you in advance.</p>