title: utf_16_le_decode SystemError when inserting pandas DataFrame with fast_executemany
body: <p>This is my code:</p>
  
  <pre><code>def insertDataFrameInDB(cursor, dataFrame, toTable, fieldNames = None):
      if fieldNames:
          dataFrame = dataFrame[fieldNames]
      else:
          fieldNames = dataFrame.columns
  
      for r in dataFrame.columns.values:
          dataFrame[r] = dataFrame[r].map(str)
          dataFrame[r] = dataFrame[r].map(str.strip)   
      params = [tuple(x) for x in dataFrame.values]
  
      fieldNameStr = ",".join(fieldNames)
      valueStr = ",".join(["?"] * len(fieldNames))
      sql = "INSERT INTO {} ({}) VALUES({})".format(toTable, fieldNameStr, valueStr)
      cursor.fast_executemany = True
      cursor.executemany(sql, params)
      cursor.commit()
  
  
  insertDataFrameInDB(cursor, df, "table")
  </code></pre>
  
  <p>It gives the following error which I really can't address:</p>
  
  <pre><code>DataError                                 Traceback (most recent call last)
  DataError: ('String data, right truncation: length 24 buffer 20', '22001')
  
  The above exception was the direct cause of the following exception:
  
  SystemError                               Traceback (most recent call last)
  ~\AppData\Local\Continuum\anaconda3\lib\encodings\utf_16_le.py in decode(input, errors)
       15 def decode(input, errors='strict'):
  ---&gt; 16     return codecs.utf_16_le_decode(input, errors, True)
       17 
  
  SystemError: &lt;built-in function utf_16_le_decode&gt; returned a result with an error set
  
  The above exception was the direct cause of the following exception:
  
  SystemError                               Traceback (most recent call last)
  SystemError: decoding with 'utf-16le' codec failed (SystemError: &lt;built-in function utf_16_le_decode&gt; returned a result with an error set)
  
  The above exception was the direct cause of the following exception:
  
  SystemError                               Traceback (most recent call last)
  ~\AppData\Local\Continuum\anaconda3\lib\encodings\utf_16_le.py in decode(input, errors)
       15 def decode(input, errors='strict'):
  ---&gt; 16     return codecs.utf_16_le_decode(input, errors, True)
       17 
  
  SystemError: &lt;built-in function utf_16_le_decode&gt; returned a result with an error set
  
  The above exception was the direct cause of the following exception:
  
  SystemError                               Traceback (most recent call last)
  SystemError: decoding with 'utf-16le' codec failed (SystemError: &lt;built-in function utf_16_le_decode&gt; returned a result with an error set)
  
  The above exception was the direct cause of the following exception:
  
  SystemError                               Traceback (most recent call last)
  &lt;ipython-input-6-f73d9346f943&gt; in &lt;module&gt;()
       12 
       13 cursor = getCursor(conData)
  ---&gt; 14 insertDataFrameInDB(cursor, df, "snowplow.sankey")
  
  &lt;ipython-input-1-69ecbca20fc8&gt; in insertDataFrameInDB(cursor, dataFrame, toTable, fieldNames)
       29     sql = "INSERT INTO {} ({}) VALUES({})".format(toTable, fieldNameStr, valueStr)
       30     cursor.fast_executemany = True
  ---&gt; 31     cursor.executemany(sql, params)
       32     cursor.commit()
  SystemError: &lt;class 'pyodbc.Error'&gt; returned a result with an error set
  </code></pre>
  
  <p>A lot of error searching makes me think it has something to do with the lack of a BOM, I tried to decode the strings in the "params" tuples, also tried str.astype('U'). Does anybody know what causes the problem and possibly how to address that?</p>