title: Inserting JSON Data into SQL Server with Python
body: <p>I have a python script that makes a call to an API, submits a request, and then is supposed to insert the result into a Sql Server 2012 table.  When it goes to execute the insert into SQL, it breaks.  I am currently importing json, requests, and pyodbc into the file.  Here is the location where it is breaking:</p>
  
  <pre><code>conn = pyodbc.connect('DRIVER={SQL Server};SERVER={localServer};DATABASE={localDB}')
  cursor = conn.cursor()
  for record in response:
      print(json.dumps(record))
      cursor.execute("Insert Into Ticket_Info values ?", json.dumps(record))
      cursor.commit()
  cursor.close()
  conn.close()
  </code></pre>
  
  <p>It is at the cursor.execute() line where the breakage occurs.  This is the error I got when I attempted to run this.</p>
  
  <blockquote>
    <p>pyodbc.ProgrammingError: ('42000', "[42000] [Microsoft][ODBC SQL
    Server Driver][SQL Server]Incorrect syntax near '@P1'. (102)
    (SQLExecDirectW); [42000] [Microsoft][ODBC SQL Server Driver][SQL
    Server]Statement(s) could not be prepared. (8180)"</p>
  </blockquote>
  
  <p>Any help I could get I would appreciate.  I have searched and tried several different methods at this point, the only thing that changes is the error.</p>