title: Inserting Data to SQL Server from a Python Dataframe Quickly
body: <p>I have been trying to insert data from a dataframe in Python to a table already created in SQL Server. The data frame has 90K rows and wanted the best possible way to quickly insert data in the table. I only have read,write and delete permissions for the server and I cannot create any table on the server.</p>
  <p>Below is the code which is inserting the data but it is very slow. Please advise.</p>
  <pre><code>import pandas as pd
  import xlsxwriter
  import pyodbc
  
  df = pd.read_excel(r&quot;Url path\abc.xlsx&quot;)
  conn = pyodbc.connect('Driver={ODBC Driver 11 for SQL Server};'
                        'SERVER=Server Name;'
                        'Database=Database Name;'
                        'UID=User ID;'
                        'PWD=Password;'
                        'Trusted_Connection=no;')
  cursor= conn.cursor()
  #Deleting existing data in SQL Table:- 
  cursor.execute(&quot;DELETE FROM datbase.schema.TableName&quot;)
  conn.commit()
  #Inserting data in SQL Table:- 
  for index,row in df.iterrows():
      cursor.execute(&quot;INSERT INTO Table Name([A],[B],[C],) values (?,?,?)&quot;, row['A'],row['B'],row['C']) 
  conn.commit()
  cursor.close()
  conn.close()
  </code></pre>