to_sql pyodbc count field incorrect or syntax error

后端 未结 3 1589
死守一世寂寞
死守一世寂寞 2020-12-05 16:02

I am downloading Json data from an api website and using sqlalchemy, pyodbc and pandas\' to_sql function to insert that data into a MSSQL server.

I can download up

3条回答
  •  庸人自扰
    2020-12-05 16:29

    Don't have a reputation so I cannot comment on Amit S. I just tried this way, with chuknum calculated with the method set to 'multi' Still shows me the error:

    [Microsoft][SQL Server Native Client 11.0][SQL Server]The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request

    So I just modified:

    chunknum=math.floor(2100/df_num_of_cols) 
    

    to

    chunknum=math.floor(2100/df_num_of_cols) - 1
    

    It seems now working perfectly. I think should be some edge problem...

提交回复
热议问题