简体   繁体   English

SQL Server 错误 - 操作数类型冲突:ntext 与 int 不兼容 -(我什至没有使用“ntext”)

[英]SQL Server error - Operand type clash: ntext is incompatible with int - (I'm not even using "ntext")

One of the columns I'm operating on is:我正在操作的专栏之一是:

Comments VARCHAR(8000)

So basically I'm trying to insert a large text of up to even 600 characters into this column Comments .所以基本上我试图在此列Comments插入最多 600 个字符的大文本。 When I run my script everything goes smoothly for first 10 rows then all of a sudden I get this error:当我运行我的脚本时,前 10 行一切顺利,然后突然我收到此错误:

pypyodbc.DataError: ('22018', '[22018] [Microsoft][ODBC SQL Server Driver][SQL Server]Operand type clash: ntext is incompatible with int') pypyodbc.DataError: ('22018', '[22018] [Microsoft][ODBC SQL Server Driver][SQL Server]操作数类型冲突:ntext 与 int 不兼容')

Then again if I rerun the query, everything will start going smoothly for next 10 rows and as you might have guessed by now I get the same error again.然后,如果我再次运行查询,接下来的 10 行一切都会开始顺利进行,正如您现在可能已经猜到的那样,我再次遇到相同的错误。

What can I do to fix this?我能做些什么来解决这个问题?

Edit :编辑

I have tried using VARCHAR(MAX) , NVARCHAR(MAX) , VARCHAR(800) , TEXT .我曾尝试使用VARCHAR(MAX)NVARCHAR(MAX)VARCHAR(800)TEXT I get the same error every time.我每次都会遇到同样的错误。

I wonder whether it is a problem with the data on row 10?请问是不是第10行的数据有问题? To test this, try deleting the data on, say, row 5, and see whether the error starts on row 9.要对此进行测试,请尝试删除第 5 行上的数据,然后查看错误是否从第 9 行开始。

I would recommend you using pmyssql instead of pypyodbc.我建议您使用pmyssql而不是 pypyodbc。 Seems like it is a driver level issue and switching to pymssql might help.似乎这是一个驱动程序级别的问题,切换到 pymssql 可能会有所帮助。 Please follow the ACOM doc and let me know if that helps.请遵循 ACOM 文档,如果有帮助,请告诉我。 If you still run into the same issue let me know as I can further try to help you.如果您仍然遇到同样的问题,请告诉我,因为我可以进一步尝试帮助您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL Server 2005:插入查询返回操作数类型冲突:ntext与smallint不兼容 - SQL Server 2005: Insert query returning Operand type clash: ntext is incompatible with smallint SQL 服务器错误“操作数类型冲突:varchar 与 int 不兼容” - SQL Server error "Operand type clash: varchar is incompatible with int " SQL Server-与工会的错误“操作数类型冲突uniqueidentifier与int不兼容” - SQL Server - error 'operand type clash uniqueidentifier is incompatible with int' with Union SQL 服务器错误操作数类型冲突:int 与日期不兼容 - SQL Server error Operand type clash: int is incompatible with date ntext与int MSSQL Server不兼容 - ntext is incompatible with int MSSQL Server SQL Server 2012(触发器)操作数类型冲突:int与日期不兼容 - SQL Server 2012 (triggers) Operand type clash: int is incompatible with date SQL Server:返回的UniqueIdentifier,操作数类型冲突:uniqueidentifier与int不兼容 - SQL Server: Returning UniqueIdentifier, Operand type clash: uniqueidentifier is incompatible with int SQL-Server - 操作数类型冲突:uniqueidentifier与int不兼容 - SQL-Server - Operand type clash: uniqueidentifier is incompatible with int SQL Server Operand类型冲突:日期与int不兼容 - Sql Server Operand type clash: date is incompatible with int SQL错误IS操作数类型冲突:int与日期不兼容 - SQL ERROR IS Operand type clash: int is incompatible with date
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM