title: pyodbc.connect() works, but not sqlalchemy.create_engine().connect()
body: <p>I am attempting to write a Python script that can take Excel sheets and import them into my SQL Server Express (with Windows Authentication) database as tables. To do this, I am using <code>pandas</code> to read the Excel files into a <code>pandas DataFrame</code>, I then hope to use <code>pandas.to_sql()</code> to import the data into my database. To use this function, however, I need to use <code>sqlalchemy.create_engine()</code>.</p>
  
  <p>I am able to connect to my database using <code>pyodbc</code> alone, and run test queries. This conection is done with the followng code:</p>
  
  <pre><code>def create_connection(server_name, database_name):
      config = dict(server=server_name, database= database_name)
  
      conn_str = ('SERVER={server};DATABASE={database};TRUSTED_CONNECTION=yes')
  
      return pyodbc.connect(r'DRIVER={ODBC Driver 13 for SQL Server};' + conn_str.format(**config))
  
  ...
  
  server = '&lt;MY_SERVER_NAME&gt;\SQLEXPRESS'
  db = '&lt;MY_DATABASE_NAME&gt;
  
  connection = create_connection(server, db)
  cursor = connection.cursor()
  cursor.execute('CREATE VIEW test_view AS SELECT * FROM existing_table')
  cursor.commit()
  </code></pre>
  
  <p>However, this isn't much use as I can't use <code>pandas.to_sql()</code> - to do so I need an engine from <code>sqlalchemy.create_engine()</code>, but I am struggling to figure out how to use my same details in my <code>create_connection()</code> function above to successfully create an engine and connect to the database.</p>
  
  <p>I have tried many, many combinations along the lines of:</p>
  
  <pre><code>engine = create_engine("mssql+pyodbc://@C&lt;MY_SERVER_NAME&gt;\SQLEXPRESS/&lt;MY_DATABASE_NAME&gt;?driver={ODBC Driver 13 for SQL Server}?trusted_connection=yes")
  conn = engine.connect().connection
  </code></pre>
  
  <p>or </p>
  
  <pre><code>engine = create_engine("mssql+pyodbc://@C&lt;MY_SERVER_NAME&gt;\SQLEXPRESS/&lt;MY_DATABASE_NAME&gt;?trusted_connection=yes")   
  conn = engine.connect().connection
  </code></pre>