-1

I would like to create this in SSIS package, wherein, it will loop in the list of files in a directory or folder and check each files if it exist in a SQL queried table. If the filename does not exist in the table, it will be archive in a different folder.

Thanks is advance for any help! =)

4

1 回答 1

0

您可以使用可以指向所述目录或文件夹的 For each Loop 容器,然后将文件名(名称和扩展名、完全限定或仅取决于要求的名称)存储在变量中,例如。循环变量。在容器内使用执行 SQL 任务,该任务具有准备好的语句,例如 - 如果存在(从 [Files] 中选择 *,其中 [FileName] = ?)选择“是”,否则选择“否” - 在参数中传递 LoopVariable 和结果映射到另一个变量 FileExists。在优先约束编辑器中使用 - 表达式 - [User::FileExists] =="No" 并连接到将文件移动到存档文件夹的文件系统任务。
注意:您可能需要形成文件路径,以防您没有从 For 循环容器中获取完全限定名称。

于 2014-04-25T20:34:47.007 回答