title: Pandas to_sql change column type from varchar to text
body: <p>I wrote a little script to copy a table between SQL servers.
  It works, but one of the columns changed type from varchar to text...
  How do I make it to copy a table with the same columns types?</p>
  
  <pre><code>import pymssql
  import pandas as pd
  from sqlalchemy import create_engine
  
  
  db_server= 1.2.3.4\\r2
  db_database="Test_DB"
  db_user="vaf"
  db_password="1234"
  
  local_db_server="1.1.1.1\\r2"
  local_db_database="Test_DB"
  local_db_user="vaf"
  local_db_password="1234"
  
  some_query=("""
  select * from some_table
  """)
  
  
  
  
  def main():
      conn=pymssql.connect(server=local_db_server,user=local_db_user,password=local_db_password,database=local_db_database,charset='UTF-8')
      data=pd.io.sql.read_sql(some_query,conn)
  
      connection_string='mssql+pymssql://{}:{}@{}/{}'.format(db_user,db_password,db_server,db_database)
      engine=create_engine(connection_string)
      data.to_sql(name="some_table",con=engine,if_exists='replace',index=False)
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>Thanks</p>