[英]Update MySQL from MS SQL Server 2008
我在Microsoft SQL Server 2008 R2 SP1中具有一个将ODBC连接到MySQL数据库的连接服务器。 ODBC驱动程序:Microsoft Windows Server 2008 R2 64位上的MySQL ODBC 5.2a
所有查询实际上都正常运行。 以及插入和更新。
问题是使用BLOB数据进行了更新。 (图片, ...)
最初它可以工作,但是当有更多数据时却没有。 然后,我限制了更新语句。
现在,它甚至无法处理一张图像。
该表有2540个数据集。 142个数据集的BLOB字段= NULL
MySQL表:
-ID int not null Primary Key
-ARTIKEL int
-BILD blob
MySQL ODBC
参数MSDAQL
参数Verbindungsserver(在MSSQL中)
这是SQL查询:
update shop...EXTERN_BILDER
set BILD = (select b.BILD from INTERN_BILDER b where b.ID = EXTERN_BILDER.ID)
where (BILD is null) AND (ID in (select ID from _temp_ID))
表_temp_ID具有要更新的ID。 我可以调整,几个。
这是来自MSDASQL的有关连接的服务器shop
的错误(尽我最大可能从德语翻译):
找不到要更新的行。 自上次读取以来,某些值已被修改。
消息7343,级别16,状态4,行2连接服务器'shop'的OLE DB提供程序'MSDASQL'无法为[shop] ... [extern_pictures]表执行UPDATE。 对于行集,在最后一次读取或同步相应行之后,使用了完全并行性并且修改了行的值。
我不懂德语,但是如果这是一个ConcurrencyViolation
问题,那么我知道可以将CommandObject
的ConflictOption
属性设置为ConflictOption.OverwriteChanges
,无论DataSet是否认为数据库已更新,它将更新数据库。与此同时。
如果无法正确解释您的问题,我们深表歉意。
似乎您尝试更新记录中的行,而该记录在您请求行时已更改。 尝试更改您的ODBC连接。
参见=> http://dev.mysql.com/doc/refman/5.5/en/connector-odbc-errors.html
Write Conflicts or Row Location Errors
How do I handle Write Conflicts or Row Location errors?
If you see the following errors, select the Return Matching Rows option in the DSN configuration dialog, or specify OPTION=2, as the connection parameter:
Write Conflict. Another user has changed your data.
Row cannot be located for updating. Some values may have been changed
since it was last read.
德语:您好,您好在der Zwischenzeitgeänderthaben住的。 调试ODBC的详细信息,请参见UPDATE trotzdemausführenkannst。 Schaue Dir den Link an,dort steht,wie du die ODBC Verbindung einstellen musst。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.