title: python error: Column names in each table must be unique. How to solve?
body: <p>I have a code that reads and concatenates files with similar structure and sends it to the database. It works well except for this particular case.</p>
  <p>part of the code I use is:</p>
  <pre><code>if file.suffix.lower() == '.xlsx' or file.suffix.upper() == '.XLSX':
       frame = pd.read_excel(file, header=0, engine='openpyxl')
  (...)
       all_df_list.append(frame)
  
  
  elif file.suffix.lower() == '.csv' or file.suffix.upper() == '.CSV':
       frameCSV = pd.read_csv(file, encoding=&quot;utf-8&quot;)
  (..)
       all_df_list.append(frameCSV )
  
  xls=pd.concat(all_df_list)
  xls.to_sql(table, con=engine, if_exists='append', index=False, chunksize=10000)
  
  </code></pre>
  <p>This particular file raises this error:</p>
  <pre><code>(pyodbc.ProgrammingError) ('42S21', &quot;[42S21] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Column names in each table must be unique. Column name 'Goal 09 - dp eur' in table 'custom_ga_goal_dpeur_carregosa' is specified more than once. (2705) (SQLExecDirectW)&quot;)
  
  [SQL: 
  CREATE TABLE dbo.custom_ga_goal_dpeur_carregosa (
      [Day] DATETIME NULL, 
      [Web Analytics Site Campaign] VARCHAR(max) NULL, 
      [Web Analytics Site Medium] VARCHAR(max) NULL, 
      [Web Analytics Site Source] VARCHAR(max) NULL, 
      [Web Analytics Site Content] VARCHAR(max) NULL, 
      [Web Analytics Keyword] VARCHAR(max) NULL, 
      [Device Category] VARCHAR(max) NULL, 
      [Goal 09 - dp eur ] FLOAT(53) NULL, 
      filename VARCHAR(max) NULL, 
      load_date VARCHAR(max) NULL, 
      [Goal 09 - dp eur] VARCHAR(max) NULL
  )
  
  </code></pre>
  <p>I know what the error means. I just wonder if there is there any way I can solve this error through coding? Like if this happens, join the columns and take only one data type?
  I can't just make a query for each case this happens because it's a lot of files and it might happen again with another file.</p>