query = 'insert into MyTable({0}) values ({1})'
query = query.format(','.join(columns), ','.join('?' * len(columns)))
cursor = connection.cursor()
for data in reader:
    cursor.execute(query, data)
cursor.commit()
Writing a csv file into SQL Server database using python