gpt4 book ai didi

python - Pyodbc 在 Sql Server 中存储 html unicode 字符串

转载 作者:太空宇宙 更新时间:2023-11-03 18:16:29 24 4
gpt4 key购买 nike

我想使用pyodbc驱动程序将html字符串存储在sql server数据库中。我已使用 nvarchar(max) 作为存储在数据库中的数据类型,但它引发以下错误

错误:

('HY000', '[HY000] [Microsoft][ODBC SQL Server Driver]Warning: Partial insert/update. The insert/update of a text or image column(s) did not succeed. (0) (SQLPutData); [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]The text, ntext, or image pointer value conflicts with the column name specified. (7125)')

最佳答案

Anthony Kong 提供的链接包含可以解决该问题的内容;我在类似的情况下也是如此。

switch to DRIVER={SQL Server Native Client 10.0} instead of DRIVER={SQL Server} in the connection string

这适用于 Sql Server 2008(您没有指定版本);对于 Sql Server 2012,它将是 Native Client 11.0。

关于python - Pyodbc 在 Sql Server 中存储 html unicode 字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24930835/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com