title: SQL Alchemy Check Connection
body: <p>I created the below method to connect to SQL Server using SQL Alchemy and Pyodbc.  </p>
  
  <pre><code>def getDBEngine(server, database):
      Params = urllib.quote_plus("DRIVER={SQL Server};SERVER="+server+";DATABASE="+database+";TRUSTED_CONNECTION=Yes")
      Engine = sa.create_engine("mssql+pyodbc:///?odbc_connect=%s" % Params)
  
      return Engine
  </code></pre>
  
  <p>I'm able to then use that engine to read and write data via methods like to_sql from pandas per the below.  </p>
  
  <pre><code>def toSQL(Server, Database, Tablename):
      writeEngine= getDatabaseEngine(Server, Database)
      data.to_sql('write_Tablename',writeEngine,if_exists='append')
  </code></pre>
  
  <p>My question is whether there is a simple way to check the connection/ status of the engine before actually using it to read or write data.  What's the easiest way?</p>