SQL 2005 SSIS - 在处理之前检查文本文件的状态

发布于 2024-10-21 08:36:34 字数 157 浏览 5 评论 0原文

创建一个 SSIS (SQL 2005) 项目,另一个进程正在将一个文本文件复制到特定目录,我想创建一个 SSIS 包,然后将该文件复制到另一个位置以处理到数据库中。问题...如何检查该文件的状态以确保它已完成复制到目录,以便我可以将其复制到其他地方?

谢谢,

德里克

Creating an SSIS (SQL 2005) project, a text file is being copied to a specific directory by another process, I want to create an SSIS package that will then copy this file to another location for processing into a database. Problem...how do I check the status of this file to ensure that it has finished being copied to the directory so that I can copy it elsewhere?

Thanks,

Derek

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

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

发布评论

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

评论(2

緦唸λ蓇 2024-10-28 08:36:34

我们通常让第一个进程在完成大文件的复制后创建一个标志文件(以及带有 .flg 后缀的空文本文件)。因此您的进程会检查标志文件是否存在。

最好从发送文件的组织那里获取 flg 文件,原因之一是他们认为文件已经完成。如果没有它,我们加载的文件在完成之前就以某种方式停止了,并消除了一半销售人员对我们网站的访问。这不是一件好事。

我们与一些客户一起使用标志文件的另一个用途是,他们将主文件应具有的记录数放入其中,现在我们可以检查以确保主文件实际上具有该记录数或停止进程。

We usually have the first process create a flag file (and empty text file with an .flg suffix) after it finishes copying the large file. So your process checks for the presence of the flag file.

One reason why it is good to have the flg file from the organization sending the file, is that they consider it to be finished. Without it we have loaded a file that was somehow stopped before it was finished on their end and eliminated half their sales force from access to our site. This is NOT a good thing.

Another use of flag files that we do with some customers is that they put the number of records in it that the main file should have, now we can check to make sure the main file actually has that number of records or stop the process.

还给你自由 2024-10-28 08:36:34

只是一个想法:
您可以尝试文件修改时间属性。
一定时间间隔后比较上次修改时间是否与可供使用的文件相同。

Just a thought :
you can try File Modified time properties.
Compare the last modified time after some interval if it is same than file ready to use.

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