SSIS 包中的 ROLLBACK 和 COMMIT 事务问题

ROLLLBACK and COMMIT transaction issue in SSIS package

我正在尝试在 SSIS package 中执行 ROLLBACK and COMMIT 事务。提交事务正在运行 fine.For 回滚事务我将空值插入到数据类型为 money.Here 我在 DFT 和 Commit 中遇到错误 SQLtask.Please 给我一个解决方案,

我将 CONTROLLFLOW properties--->TransactionRequired 更改为必填项

DFT TransactionRequired---->Supported

请朋友们帮帮我 提前致谢

错误如下所示

[Execute SQL Task] Error: Executing the query "Rollback tran" failed with the following error: "Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

[OLE DB Destination [2]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E21. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".

[OLE DB Destination [2]] Error: There was an error with OLE DB Destination.Inputs[OLE DB Destination Input].Columns[CustomerAmount] on OLE DB Destination.Inputs[OLE DB Destination Input]. The column status returned was: "The value violated the integrity constraints for the column.".

[OLE DB Destination [2]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "OLE DB Destination.Inputs[OLE DB Destination Input]" failed because error code 0xC020907D occurred, and the error row disposition on "OLE DB Destination.Inputs[OLE DB Destination Input]" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.

[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "OLE DB Destination" (2) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (15). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.

您缺少 SSIS 和事务处理的两种方法。如果您使用的是 SSIS 本机事务(设置 TransactionRequired=Required),则不需要调用 Rollback。如果发生错误或您故意设置错误,事务将自动回滚。重要的概念 - 交易范围,即何时提交。我的建议——在专用 序列容器 上声明事务;离开此 Sequence Container.
时将提交事务 如果要使用 SQL CommitRollback 的事务处理,则不要使用 TransactionRequired=Required。这是 MS SQL 的特例,详情请参阅 and TransactionOption in SSIS