SQL Server 事务回滚
我们有一个复杂的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我改用 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