title: Pandas to_sql changing datatype in database table
body: <p>Has anyone experienced this before?</p>
  
  <p>I have a table with "int" and "varchar" columns - a report schedule table.</p>
  
  <p>I am trying to import an excel file with ".xls" extension to this table using a python program. I am using pandas to_sql to read in 1 row of data.</p>
  
  <p>Data imported is 1 row 11 columns.</p>
  
  <p>Import works successfully but after the import I noticed that the datatypes in the original table have now been altered from:</p>
  
  <pre><code>        int --&gt; bigint
          char(1) --&gt; varchar(max)
          varchar(30) --&gt; varchar(max)
  </code></pre>
  
  <p>Any idea how I can prevent this? The switch in datatypes is causing issues in downstrean routines.</p>
  
  <pre><code>   df = pd.read_excel(schedule_file,sheet_name='Schedule')
     params = urllib.parse.quote_plus(r'DRIVER={SQL Server};SERVER=&lt;&lt;IP&gt;&gt;;DATABASE=&lt;&lt;DB&gt;&gt;;UID=&lt;&lt;UDI&gt;&gt;;PWD=&lt;&lt;PWD&gt;&gt;')
     conn_str = 'mssql+pyodbc:///?odbc_connect={}'.format(params)
     engine = create_engine(conn_str)
  
     table_name='REPORT_SCHEDULE'
     df.to_sql(name=table_name,con=engine, if_exists='replace',index=False)
  </code></pre>
  
  <p>TIA</p>