SQL Server 事务回滚

发布于 2024-09-30 19:50:22 字数 283 浏览 0 评论 0原文

我们有一个复杂的 SSIS 作业,在每个事务中我们必须在 SQL Server 中插入大约 30K+ 记录。该包使用带有 trans start 和 rollback 语句的本地事务。我对这种事务回滚行为感到有点困惑,当它回滚时,它不会从其中一个表中清除 2-3 条记录。当我发出回滚时,它应该清除表中所有插入的记录,但这并没有发生,而是在表中留下 2-3 条记录,这是错误的。

另外,业务需求是在一个事务中创建所有记录或回滚所有创建的记录,我无法进行部分提交。我希望这能让人们清楚地了解正在发生的事情。

有什么想法吗?

We have a complex SSIS job and in each transaction we have to inserts around 30K+ records in SQL server. The package is using the local transactions with trans start and rollback statements. I am bit puzzled with this transaction rollback behaviour where it is NOT clearning 2-3 records from one of the table when it rolls back. When I issue a rollback then it should clean all the inserted records in the table but this is NOT happening and instead it is leaving 2-3 records in the table, which is wrong.

Also, the business needs is to either create all the records in one transaction or rollback all the create ones, I cannot do partial commits. I hope this gives a clear picture of what is happening.

Any thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

大海や 2024-10-07 19:50:22

我改用 MSDTC 来处理 SSIS 中的这些事务。对我来说,这听起来像是一种使用开始和提交事务语义的解决方法,我猜想部分回滚的原因。切换到MSDTC后,该问题得到解决。

非常感谢

I switched to MSDTC to handle these transactions in SSIS. To me it sounded like a work around to use the begin and commit transactions semantics and I guess the reason for partial rollback. After switching to MSDTC, this issue is resolved.

Many thanks

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文