SQL Server Integration Services - 将失败记录重定向到平面文件目标
观察 SSIS 包的以下片段:
右侧的两个平面文件目标任务都配置为写入到同一个平面文件连接管理器,因为我希望所有失败的记录都重定向到同一个文件,无论哪个任务导致它们失败。
SSIS 抱怨第二个平面文件目标,称输出文件正在被另一个进程使用。
我所说的目标根本不可能吗?或者有没有办法将所有失败的记录重定向到同一个输出文件?
Observe the following snippet of an SSIS package:
Both of the Flat File Destination tasks on the right are configured to write to the same Flat File Connection Manager, because I want all the failing records to be redirected to the same file regardless of which task caused them to fail.
SSIS is complaining on the second Flat File Destination, saying that the output file is in use by another process.
Is my stated goal simply impossible, or is there a way to redirect all failing records to the same output file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,你不能这样做。在将来自不同源/转换的输出写入同一目标之前,您需要使用 Union All 来组合输出。
如果您有问题中描述的流程,则包将在第二个目标组件上失败。
错误消息为“该进程无法访问该文件,因为该文件正在被另一个进程使用”。
要解决此问题,请添加 Union All 转换,该转换将从派生列转换中获取错误输出并将其与然后,OLE DB 目标的错误输出和 Union All 转换的输出将传递到平面文件目标。
希望有帮助。
No, you cannot do it this way. You need to use an Union All to combine the output before writing the output from different sources/transformations to the same destination.
If you have a process flow as described in the question, the package will fail on the second destination component.
The error message would be `The process cannot access the file because it is being used by another process.
To fix the issue, add a Union All transformation that will take the error output from Derived Column transformation and combines it with the error output from OLE DB Destination and the output of Union All transformation is then passed on to the Flat File destination.
Hope that helps.