title: "Conversion failed when converting date" while inserting CSV data
body: <p>I am attempting to insert data into a SQL table from a CSV using the following code:</p>
  
  <pre><code>with requests.get(reportURL) as csvfile:
      decoded_content=csvfile.content.decode('utf-8')
      reader = csv.reader(decoded_content.splitlines(), delimiter=',')
      columns = next(reader,None)
      query = "INSERT INTO SQL_TABLE({0}) VALUES ({1})"
      query = query.format('[{0}]'.format('],['.join(columns)),','.join('?'*len(columns)))
      cursor = cnxn.cursor()
      cursor.execute(query, columns)
      for data in reader:
          cursor.execute(query, data)
      cursor.commit() 
  </code></pre>
  
  <p>However, I am receiving the following error code:</p>
  
  <blockquote>
    <p>cursor.execute(query, columns) pyodbc.DataError: ('22007', '[22007]
    [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Conversion
    failed when converting date and/or time from character string. (241)
    (SQLExecDirectW)')</p>
  </blockquote>
  
  <p>I am wondering if the issue is that the data is coming through as a string instead of date? Date is the first column, so I am not sure if any of the other columns would run into a similar issue.
  Columns are as follows:</p>
  
  <blockquote>
    <p>Date | Advertiser | Campaign | Ad Group | Impressions</p>
  </blockquote>
  
  <p>Data Type:</p>
  
  <blockquote>
    <p>datetime | varchar | varchar | varchar | bigint  </p>
  </blockquote>
  
  <p>Thank you for the help!</p>